diff --git a/README.md b/README.md index 95fad39..9c744ed 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/). - Disqus - Utteranc.es - RSS feeds +* Hiding posts from the RSS feed - Translations (en, ru, fr, pl) - Custom CSS/JS - Multilingual mode @@ -123,6 +124,9 @@ For production — allow all, for other — disallow all. ### Favorite posts To mark posts as favorite just add `favorite: true` in post's front matter. It adds a "★" icon nearby post's title. +### Hiding posts from RSS +To hide a post from the RSS feed, just add `disable_feed: true` to its front matter. + ### Pagination on post single page Enabled by `paginationSinglePost` param in `params` section of config. diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 473a96f..cb728d9 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,6 +1,6 @@ {{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := $pctx.RegularPages -}} +{{- $pages := where $pctx.RegularPages ".Params.disable_feed" "!=" true -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} @@ -31,4 +31,4 @@ {{ end }} - \ No newline at end of file +