feat: add ability to hide posts in blog overview
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:
Deploy Preview for hugo-hextra ready!
| Name | Link |
|---|---|
| Latest commit | 8a493c77df8737ecda187a8aa245a5b0201277e0 |
| 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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Thank you, I like this idea. I will take a look
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