Skip to content
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

feat: add ability to hide posts in blog overview #219

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

otherpaco
Copy link

@otherpaco otherpaco commented Nov 23, 2023

I wanted to use the starting page as blog.
But then all entries like "/about" or "/imprint" will show up as posts as they all are in the same folder content.

I added a param hideOnBlog to the front matter. That parameter will prevent the file from being listed in the blog overview but it is still accessible.

Here is a linkt to the code of a wip blog that shows what I want to achieve:

https://codeberg.org/otherpaco/p11io-hextra

Copy link

netlify bot commented Nov 23, 2023

Deploy Preview for hugo-hextra ready!

Name Link
🔨 Latest commit 8a493c7
🔍 Latest deploy log https://app.netlify.com/sites/hugo-hextra/deploys/655fc921ca5726000837abee
😎 Deploy Preview https://deploy-preview-219--hugo-hextra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@otherpaco otherpaco changed the title feat: add ability to hide posts in blog listing feat: add ability to hide posts in blog overview Nov 23, 2023
@imfing
Copy link
Owner

imfing commented Nov 26, 2023

Thank you, I like this idea. I will take a look

@otherpaco
Copy link
Author

Dear Xin, it realized there is much more to do and check to use the starting page as blog.
I will keep on modifying my blog an will come back with a better PR or a feature request.

I removed the new parameter because I can simply use

{{- if eq .Params.type "blog" -}}

instead of

{{- if not .Params.hideOnBlog -}}

But there are more places I would need to add that e.g. layouts/partials/components/pager.html

Maybe it would be easier going with collections.Where gohugo docs

Feel free to close this PR and I could move the info to an issue if you prefer it that way.

Have a nice weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants