From d479fbd802f73d95673cf86ddfedcee82a20d182 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 18 Jan 2021 21:08:07 +0100 Subject: [PATCH 1/2] allow hiding post from RSS feed This uses the `disable_feed` parameter from a post's frontmatter --- layouts/_default/rss.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 + From 549c98a1094f164541163550c1320fd1f82c669a Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 23 Jan 2021 16:15:00 +0100 Subject: [PATCH 2/2] Mention 'hide_feed' in README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0036d09..728858b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/). - Google Analytics - Disqus - RSS feeds +* Hiding posts from the RSS feed - Translations (en, ru, fr, pl) - Custom CSS/JS - Multilingual mode @@ -115,6 +116,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.