diff options
author | Raphael Reitzig <4246780+reitzig@users.noreply.github.com> | 2020-05-12 11:32:23 +0300 |
---|---|---|
committer | Raphael Reitzig <4246780+reitzig@users.noreply.github.com> | 2020-05-12 11:33:21 +0300 |
commit | 92e15bc34eee080fe61241cf93382c7da190eda2 (patch) | |
tree | 52fd5e93cf2119c150c6989fbb89d11d360c27bd /layouts | |
parent | a2f758d67a9b6f66e2ee15eff51101cf0f1beed2 (diff) |
Set robots meta tag from page front matter.
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/head.html | 5 | ||||
-rw-r--r-- | layouts/sitemap.xml | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index cf34a67..a953574 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -20,4 +20,7 @@ {{- partial "style.html" . -}} {{- partial "rss-feed.html" . -}} {{- partial "twitter-card.html" . -}} -{{- partial "head-extra.html" . -}}
\ No newline at end of file +{{- if .Params.Robots -}} +<meta name="robots" content="{{ .Params.robots }}" /> +{{- end -}} +{{- partial "head-extra.html" . -}} diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml index ae1b5c8..f77c10a 100644 --- a/layouts/sitemap.xml +++ b/layouts/sitemap.xml @@ -2,6 +2,7 @@ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> {{- range .Data.Pages -}} + {{- if not (in .Params.Robots "noindex") -}} <url> <loc>{{- .Permalink -}}</loc>{{- if not .Lastmod.IsZero -}} <lastmod>{{- safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) -}}</lastmod>{{- end -}}{{- with .Sitemap.ChangeFreq -}} @@ -19,4 +20,5 @@ />{{- end -}} </url> {{- end -}} + {{- end -}} </urlset>
\ No newline at end of file |