diff options
author | Léo De Souza <43355143+de-souza@users.noreply.github.com> | 2019-02-19 23:08:36 +0300 |
---|---|---|
committer | Léo De Souza <43355143+de-souza@users.noreply.github.com> | 2019-02-19 23:08:36 +0300 |
commit | 561c9f9bb62c05cde8014a8477fafa97c74cbcba (patch) | |
tree | 5dbb868751b6107881640eec29a3bc84f915a25c /layouts/_default/baseof.html | |
parent | 5546f222628e808003384ef9cf360356623920f3 (diff) |
Add possibility to embed javascript + fix embed on homepage
Diffstat (limited to 'layouts/_default/baseof.html')
-rw-r--r-- | layouts/_default/baseof.html | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index efbd17a..b59fe62 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,7 +1,17 @@ +{{ block "preload" . }} + +{{ range .Params.css }} +{{ slice . | $.Scratch.Add "css" }} +{{ end }} +{{ range .Params.js }} +{{ slice . | $.Scratch.Add "js" }} +{{ end }} + +{{ end }} + {{ $site := .Site.Title | default "Hugo Flex" }} <!DOCTYPE html> <html lang="{{ .Site.LanguageCode }}"> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> @@ -17,11 +27,12 @@ {{ end }} <style> {{ partialCached "critical.css" . | safeCSS }} - {{ range .Params.css }}{{ partial . | safeCSS }}{{ end }} + {{ range (.Scratch.Get "css") }} + {{ partial . | safeCSS }} + {{ end }} </style> {{ .Hugo.Generator }} </head> - <body> <nav class="background"> <div class="wrapper"> @@ -53,6 +64,10 @@ </div> </footer> {{ end }} + {{ range (.Scratch.Get "js") }} + <script> + {{ partial . | safeJS }} + </script> + {{ end }} </body> - </html>
\ No newline at end of file |