-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Show HN" should not be displayed on the homepage #5
Comments
if you want to change it from backend then, on HeckarNews/rest-api/routes/items/api.js Line 626 in e535db3
type: "news" .
However if you don't want to filter from backend, then on front end you can filter it manually on HeckarNews/website/pages/index.js Line 45 in e535db3
const _apiResult = await getRankedItemsByPage(page, req);
const apiResult = _apiResult?.items?.filter(item => item.type === "news") I haven't tested the code above, but I think it should work like that |
Thank you for your reply, After the modification, the homepage does not display any content at all. Sorry, my expression is wrong, I think "Show HN" type items are only displayed in the "Show" column (https://forum.krehwell.com/show) , and should not be displayed in the following places "https://forum.krehwell.com/", "https://forum.krehwell.com/news", "https://forum.krehwell.com/newest". |
it's just wrong logic actually, you can log it in console, after modification, const apiResult = await getRankedItemsByPage(page, req);
const items = apiResult?.items?.filter((item) => item.type === "news");
return {
props: {
items: items || [],
...
}
} now it should be good. Do this to the rest of the page if you want to do the filtering from client |
That's cool! the problem is solved, thank you very much! |
The official "Show HN" is not displayed on the homepage (https://news.ycombinator.com/show), How can I set it to not show on the homepage (see https://forum.krehwell.com/)?
The text was updated successfully, but these errors were encountered: