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
|
- Disqus
|
||||||
- Utteranc.es
|
- Utteranc.es
|
||||||
- RSS feeds
|
- RSS feeds
|
||||||
|
* Hiding posts from the RSS feed
|
||||||
- Translations (en, ru, fr, pl)
|
- Translations (en, ru, fr, pl)
|
||||||
- Custom CSS/JS
|
- Custom CSS/JS
|
||||||
- Multilingual mode
|
- Multilingual mode
|
||||||
@ -123,6 +124,9 @@ For production — allow all, for other — disallow all.
|
|||||||
### Favorite posts
|
### Favorite posts
|
||||||
To mark posts as favorite just add `favorite: true` in post's front matter. It adds a "★" icon nearby post's title.
|
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
|
### Pagination on post single page
|
||||||
Enabled by `paginationSinglePost` param in `params` section of config.
|
Enabled by `paginationSinglePost` param in `params` section of config.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{{- $pctx := . -}}
|
{{- $pctx := . -}}
|
||||||
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
|
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
|
||||||
{{- $pages := $pctx.RegularPages -}}
|
{{- $pages := where $pctx.RegularPages ".Params.disable_feed" "!=" true -}}
|
||||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
||||||
{{- if ge $limit 1 -}}
|
{{- if ge $limit 1 -}}
|
||||||
{{- $pages = $pages | first $limit -}}
|
{{- $pages = $pages | first $limit -}}
|
||||||
@ -31,4 +31,4 @@
|
|||||||
</item>
|
</item>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
|
Loading…
Reference in New Issue
Block a user