mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 02:16:09 +00:00
Fix the AlternativeOutputFormats/OutputFormats examples
Ref: https://github.com/gohugoio/hugo/pull/4925#issuecomment-403940096, https://github.com/gohugoio/hugo/issues/5032 Also fix https://gohugo.io/templates/rss/ returning 404.
This commit is contained in:
1 parent
f64a224692
commit
ce14da4350
1 file changed
+2
-3
@@ -14,7 +14,6 @@ menu:
|
|||||||
weight: 150
|
weight: 150
|
||||||
sections_weight: 150
|
sections_weight: 150
|
||||||
draft: false
|
draft: false
|
||||||
aliases: [/templates/rss/]
|
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -100,7 +99,7 @@ In your `header.html` template, you can specify your RSS feed in your `<head></h
|
|||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ range .AlternativeOutputFormats -}}
|
{{ range .AlternativeOutputFormats -}}
|
||||||
{{ printf `<link rel="%s" type="%s+%s" href="%s" title="%s" />` .Rel .MediaType.Type .MediaType.Suffix .Permalink $.Site.Title | safeHTML }}
|
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -108,7 +107,7 @@ If you only want the RSS link, you can query the formats:
|
|||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ with .OutputFormats.Get "rss" -}}
|
{{ with .OutputFormats.Get "rss" -}}
|
||||||
{{ printf `<link rel="%s" type="%s+%s" href="%s" title="%s" />` .Rel .MediaType.Type .MediaType.Suffix .Permalink $.Site.Title | safeHTML }}
|
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user