From 6da23e4e20105bc73af0602dd6a1becc18cbf206 Mon Sep 17 00:00:00 2001 From: Track3 Date: Fri, 1 Feb 2019 18:14:07 +0800 Subject: [PATCH] Put metadata tags into partial And update example config.toml (relate to #40) --- exampleSite/config.toml | 4 +++- layouts/_default/baseof.html | 4 +--- layouts/partials/structured-data.html | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 layouts/partials/structured-data.html diff --git a/exampleSite/config.toml b/exampleSite/config.toml index ad9ae5f..f5f6886 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -17,7 +17,9 @@ enableEmoji = true # Shorthand emojis in content files - https://gohugo.io/func name = "John Doe" [blackfriday] - hrefTargetBlank = true + # hrefTargetBlank = true + # noreferrerLinks = true + # nofollowLinks = true [taxonomies] tag = "tags" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 18941b2..b495afe 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -9,9 +9,7 @@ {{- end }} - {{- template "_internal/schema.html" . }} - {{- template "_internal/opengraph.html" . }} - {{- template "_internal/twitter_cards.html" . }} + {{- partial "structured-data.html" . }} {{- partial "favicons.html" }} {{.Title}} {{ range .AlternativeOutputFormats -}} diff --git a/layouts/partials/structured-data.html b/layouts/partials/structured-data.html new file mode 100644 index 0000000..4bfb909 --- /dev/null +++ b/layouts/partials/structured-data.html @@ -0,0 +1,6 @@ +{{/* We use some Hugo built-in templates, you can find their source here: */}} +{{/* https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}} + +{{- template "_internal/schema.html" . }} +{{- template "_internal/opengraph.html" . }} +{{- template "_internal/twitter_cards.html" . }}