Header: Only output RSS link if it's actually set

If a subpage doesn't have any RSS link, don't output an empty link.
This commit is contained in:
v1ne
2019-11-19 22:16:58 +01:00
committed by Carson Ip
parent 32e4690938
commit e1dd4d7d06

View File

@@ -6,8 +6,10 @@
{{ partial "meta.html" . }}
{{ partial "og.html" . }}
<link href="{{ with .OutputFormats.Get "RSS" }}{{ .Permalink }}{{ end }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link rel="shortcut icon" href="/favicon.png">
{{- with .OutputFormats.Get "rss" -}}
<link href="{{ .Permalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
{{- end }}
<link rel="shortcut icon" href="/favicon.ico">
<link href="{{ "webfonts/ptserif/main.css" | absURL }}" rel='stylesheet' type='text/css'>
<link href="{{ "webfonts/source-code-pro/main.css" | absURL }}" rel="stylesheet" type="text/css">