Add RSS template that excludes "unlisted = true" posts#552
Add RSS template that excludes "unlisted = true" posts#552ashton314 wants to merge 3 commits intoalex-shpak:mainfrom
Conversation
| {{- if ge $limit 1 -}} | ||
| {{- $pages = $pages | first $limit -}} | ||
| {{- end -}} | ||
| {{- $pages = (where $pages ".Params.unlisted" "!=" "true") -}} |
There was a problem hiding this comment.
This is the critical line that excludes unlisted posts from the RSS feed.
There was a problem hiding this comment.
Should this line be above the limit handling? To apply the limit only to listed pages.
|
Hi! |
Absolutely! In the tech circles I hang out in, RSS is very much appreciated. In fact, if hugo-book didn't have RSS I wouldn't have begun to consider it. |
|
I don't have terribly accurate metrics (by design; I don't want to track my readers) but I do know at least one person reads my blog via RSS. I would like to encourage more people to use RSS, so this is an important feature to me. |
|
I haven't used it in long time. Otherwise looks alright, I would probably change layout a bit down the road |
This adds the default Hugo RSS template explicitly, and adds an option to exclude posts from the RSS feed.
(Idea from https://bphogan.com/2020/08/11/2020-08-11-creating-unlisted-content-in-hugo/)