mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
---
|
||||
title: RSS templates
|
||||
description: Use the embedded RSS template, or create your own.
|
||||
categories: [templates]
|
||||
categories: []
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: templates
|
||||
weight: 150
|
||||
weight: 150
|
||||
toc: true
|
||||
weight: 140
|
||||
---
|
||||
|
||||
## Configuration
|
||||
@@ -52,7 +47,7 @@ email = 'jdoe@example.org'
|
||||
To include a feed reference in the `head` element of your rendered pages, place this within the `head` element of your templates:
|
||||
|
||||
```go-html-template
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ with .OutputFormats.Get "rss" }}
|
||||
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
|
||||
{{ end }}
|
||||
```
|
||||
@@ -67,9 +62,6 @@ Hugo will render this to:
|
||||
|
||||
Override Hugo's [embedded RSS template] by creating one or more of your own, following the naming conventions as shown in the [template lookup order].
|
||||
|
||||
[embedded RSS template]: {{% eturl rss %}}
|
||||
[template lookup order]: /templates/lookup-order/#rss-templates
|
||||
|
||||
For example, to use different templates for home, section, taxonomy, and term pages:
|
||||
|
||||
```text
|
||||
@@ -82,3 +74,6 @@ layouts/
|
||||
```
|
||||
|
||||
RSS templates receive the `.Page` and `.Site` objects in context.
|
||||
|
||||
[embedded RSS template]: {{% eturl rss %}}
|
||||
[template lookup order]: /templates/lookup-order/#rss-templates
|
||||
|
Reference in New Issue
Block a user