1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-17 17:57:04 +01:00

layouts/_default/baseof.html: Smarter meta description

Use the post's meta description if it exists, otherwise use the
one from the site's config. Set them using the "description" key
in frontmatter or site config.

Note: this means there is no way to NOT have a description. You
must have *at least* a site-wide description and *optionally* a
description for each page/post's front matter.
This commit is contained in:
Alan Orth 2016-09-14 13:43:52 +03:00
parent cd3e327553
commit c5bacecad6
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{{ "<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->" | safeHTML }} {{ "<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->" | safeHTML }}
{{ if .Site.Params.description }}<meta name="description" content="{{ .Site.Params.description }}">{{ end }} <meta name="description" content="{{ .Params.description | default .Site.Params.description }}">
{{ if .Site.Params.author }}<meta name="author" content="{{ .Site.Params.author }}">{{ end }} {{ if .Site.Params.author }}<meta name="author" content="{{ .Site.Params.author }}">{{ end }}
{{ if .Site.Params.google_verify_meta }}<meta name="google-site-verification" content="{{ .Site.Params.google_verify_meta }}">{{ end }} {{ if .Site.Params.google_verify_meta }}<meta name="google-site-verification" content="{{ .Site.Params.google_verify_meta }}">{{ end }}