Merge pull request #77 from Ambroisie/add-rss-disable-feature
Allow hiding posts from RSS feed
This commit is contained in:
commit
b43d933019
@ -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.
|
||||
|
||||
|
@ -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 @@
|
||||
</item>
|
||||
{{ end }}
|
||||
</channel>
|
||||
</rss>
|
||||
</rss>
|
||||
|
Loading…
Reference in New Issue
Block a user