diff options
author | Etienne Dechamps <etienne@edechamps.fr> | 2017-11-14 10:21:16 +0300 |
---|---|---|
committer | Juraj Bubniak <juraj.bubniak@gmail.com> | 2017-11-14 10:21:16 +0300 |
commit | 541925a8576418d47f687c46183358a47034bac2 (patch) | |
tree | 68da37f381d760ea7de2c91677cfcdfdca02de1c | |
parent | 1555cbf952150c95beb33264aea9a7c004d46caa (diff) |
Add a new "extra-in-head" customizable partial. (#40)
The partial is empty as it is meant as an extension point for users,
who can use it to inject arbitrary HTML into <head> without having to
maintain a fork of the theme.
Background: https://discourse.gohugo.io/t/how-to-override-css-classes-with-hugo/3033/9
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | layouts/partials/extra-in-head.html | 0 | ||||
-rw-r--r-- | layouts/partials/header.html | 1 |
3 files changed, 4 insertions, 0 deletions
@@ -96,3 +96,6 @@ disqusShortname = "XXX" url = "/page/about/" weight = 4 ``` + +You can also inject arbitrary HTML into `<head>` simply by overriding the `extra-in-head.html` +partial, which is meant for that purpose. diff --git a/layouts/partials/extra-in-head.html b/layouts/partials/extra-in-head.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/partials/extra-in-head.html diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 5c553b3..7414913 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -17,6 +17,7 @@ {{ if .RSSLink }} <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml"> {{ end }} + {{ partial "extra-in-head.html" . }} </head> <body> {{ template "_internal/google_analytics.html" . }} |