diff options
author | Daniele Sluijters <daenney@users.noreply.github.com> | 2022-09-29 23:15:13 +0300 |
---|---|---|
committer | Daniele Sluijters <daenney@users.noreply.github.com> | 2022-09-30 18:55:48 +0300 |
commit | a1c959db92b7fd3876272a39ce09fb212a17ef2a (patch) | |
tree | fb6813f606f058d337d0adddfe8eedce3c26b3c1 | |
parent | 2174285f03fb435e4202c98e23eb216b32cc89fe (diff) |
Add feed syndication
This adds the alternative outputs as tags in the <head>, enabling
the inclusion of RSS, ATOM and othe types of output types.
For example, with:
[outputs]
home = ["HTML", "RSS"]
This will now result in outputting a <link rel="alternate"
type="application/rss+xml" href="...index.xml" title="..."/>
It's implemented as described on: https://gohugo.io/templates/rss/.
-rw-r--r-- | layouts/partials/head.html | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 630b4b4..0fea61f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -18,6 +18,9 @@ {{ if site.Params.opengraph }} {{ template "_internal/opengraph.html" . }} {{- end }} +{{ range .AlternativeOutputFormats -}} + {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} +{{ end -}} <link rel="stylesheet" href="{{ .Site.BaseURL }}css/latex.css" /> <link rel="stylesheet" href="{{ .Site.BaseURL }}css/main.css" /> {{ if site.Params.darkmode }} |