Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/carsonip/hugo-theme-minos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorv1ne <v1ne2go@gmail.com>2019-11-20 00:16:58 +0300
committerCarson Ip <carsonip@users.noreply.github.com>2019-11-29 18:04:51 +0300
commite1dd4d7d067c0476a89c8e0dc9e7f8d4d56d5e16 (patch)
tree97f9cc41df6fab4f6adad81fa59dc45802a70c98
parent32e4690938851684558768be6b3b68911f327536 (diff)
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.
-rw-r--r--layouts/partials/head.html6
1 files changed, 4 insertions, 2 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 51aa5f4..e2b9c57 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -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">