How to exclude a Section from RSS output ? #132
Replies: 2 comments
-
|
I found this blog but I suppose it means to create I am looking for a more parametrial way... |
Beta Was this translation helpful? Give feedback.
-
|
The solution that I found, if it can help someone : Customize Your Hugo Blog RSS feed
# Limit the number of articles in your RSS feed
services:
RSS:
limit: 10
# Change the default index.xml to feed.xml
outputFormats:
RSS:
mediatype: "application/rss"
baseName: "feed"
outputs:
home:
- HTML
- Offline # required by PWA module for displaying the offline pages.
- RSS
- SearchIndex # required by search module.
- WebAppManifest # required by PWA module to make your site installable.
# default outputs for other kinds of pages (avoid produce RSS unecessarily).
section: ['html']
taxonomy: ['html']
term: ['html']To customize the XML of your RSS feed, you need to override the default template. For this, create a file named For example in my case - display just type "page" (not the Categories, Authors, etc ) and only "posts" section, then I diplay the full content with my Github avatar as front image: {{- range where (where .Site.Pages ".Section" "posts") "Kind" "page" }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid>
{{- $content := safeHTML (.Content | html) -}}
<description>
{{ "<" | html }}img src="https://avatars.githubusercontent.com/u/35733045?v=4" alt="Featured image for {{ .Title }}" {{ "/>" | html}}
{{ $content }}
</description>
</item>
{{- end }} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Guys,
Does someone know, how to disactivate or exclude RSS indexing on a full Section (in my case
./content/docs) ?Hugo doc talk about output formats generated for each page kind...
If someone can give a tips on this.
Regards,
Beta Was this translation helpful? Give feedback.
All reactions