From b1d8f1ac770800352657c80eb9da90ccb7ca2101 Mon Sep 17 00:00:00 2001 From: Greg Anders Date: Thu, 5 Mar 2020 07:32:15 -0700 Subject: Include data in a separate partial This allows theme users to easily customize what they want to include in the of their documents. --- layouts/_default/baseof.html | 15 +-------------- layouts/partials/head.html | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 layouts/partials/head.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8c412ea..c959174 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,20 +1,7 @@ - - - {{ hugo.Generator }} - {{ if site.Params.schema }}{{ template "_internal/schema.html" . }}{{ end }} - {{ if site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }} - {{ if site.Params.twittercards }}{{ template "_internal/twitter_cards.html" . }}{{ end }} - - {{ if eq .Title site.Title }} - {{ site.Title }} - {{ else }} - {{ with .Title }}{{ . }} | {{ end }}{{ site.Title }} - {{ end }} - - + {{ partial "head.html" . }} {{ range .AlternativeOutputFormats }} {{ printf "" .Rel .MediaType .Permalink site.Title | safeHTML }} {{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..24b71a7 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,14 @@ + + +{{ hugo.Generator }} +{{ if site.Params.schema }}{{ template "_internal/schema.html" . }}{{ end }} +{{ if site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }} +{{ if site.Params.twittercards }}{{ template "_internal/twitter_cards.html" . }}{{ end }} + + {{ if eq .Title site.Title }} + {{ site.Title }} + {{ else }} + {{ with .Title }}{{ . }} | {{ end }}{{ site.Title }} + {{ end }} + + -- cgit v1.2.3