1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-25 05:30:18 +01:00
hugo-theme-bootstrap4-blog/layouts/partials/head-meta.html
Alan Orth 8ab05ae625
Add Schema.org implementation based on JSON-LD
This replaces the metadata that Hugo's own schema.html template had
been providing, but does so in JSON-LD notation rather than via the
use of <meta> tags (this is Google's currently recommended form of
specifying this markup). There are a few exceptions where I did not
follow the conventions used in Hugo's template, for example the use
of up to six images from a post's frontmatter, because Google's tool
only recognizes one image, as well as different logic for a post's
publish and modified dates (using enableGitInfo = true).

Using this new markup, Google's Structured Data Testing Tool is now
able to understand site metadata much better (before it was reading
none).

The implementation here is a mix of the elements and types from the
official Schema.org types—for example, Blog and BlogPosting—as well
as from Google's search documentation. Note that Google's docs are
geared towards AMP, where some metadata is required, while for non-
AMP pages the metadata is just recommended.

We will have to re-evaluate this in the future, for example to add
height and width information to image metadata.

See: https://schema.org/Blog
See: https://schema.org/BlogPosting
See: https://developers.google.com/search/docs/data-types/data-type-selector
See: https://search.google.com/structured-data/testing-tool
2017-01-20 15:58:30 +02:00

22 lines
591 B
HTML

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{- with .Site.Params.google_verify_meta -}}
<meta name="google-site-verification" content="{{ . }}" />
{{ end }}
{{- with .Site.Params.bing_verify_meta -}}
<meta name="msvalidate.01" content="{{ . }}" />
{{ end }}
{{- with .Site.Params.yandex_verify_meta -}}
<meta name="yandex-verification" content="{{ . }}" />
{{ end }}
{{- .Hugo.Generator -}}
{{- /* vim: set ts=2 sw=2 et: */}}