diff options
author | zzossig <zzossig@gmail.com> | 2020-02-16 09:14:46 +0300 |
---|---|---|
committer | zzossig <zzossig@gmail.com> | 2020-02-16 09:14:46 +0300 |
commit | 9ae4e13608276df6df08d0af09397cbb68c81604 (patch) | |
tree | 09804c1dc75e4a88b0be85960359dafeef1ecc09 | |
parent | 5d3f228df9deacb82cb2a8038654a684ac4d9b6e (diff) |
custom css, js support
-rw-r--r-- | layouts/partials/head/scripts.html | 10 | ||||
-rw-r--r-- | layouts/partials/head/styles.html | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/layouts/partials/head/scripts.html b/layouts/partials/head/scripts.html index 83e00b0..d4985a9 100644 --- a/layouts/partials/head/scripts.html +++ b/layouts/partials/head/scripts.html @@ -1,3 +1,13 @@ +{{ if .Site.Params.custom_js }} +{{ range .Site.Params.custom_js }} + {{ $custom_template := resources.Get . }} + {{ if $custom_template }} + {{ $custom_js := $custom_template | resources.Minify | resources.Fingerprint }} + <script defer src="{{ $custom_js.RelPermalink }}"></script> + {{ end }} +{{ end }} +{{ end }} + {{ $enquire := resources.Get "js/enquire.min.js" | resources.Fingerprint }} <script src="{{ $enquire.RelPermalink }}"></script> {{ $fuse := resources.Get "js/fuse.min.js" | resources.Fingerprint }} diff --git a/layouts/partials/head/styles.html b/layouts/partials/head/styles.html index 56ca3a6..624cdcb 100644 --- a/layouts/partials/head/styles.html +++ b/layouts/partials/head/styles.html @@ -2,3 +2,13 @@ {{ $main_template := resources.Get "sass/main.scss" }} {{ $main_style := $main_template | resources.ExecuteAsTemplate "main_parsed.scss" . | toCSS $main_options | resources.Minify }} <link rel="stylesheet" href="{{ $main_style.RelPermalink }}"> + +{{ if .Site.Params.custom_css }} +{{ range .Site.Params.custom_css }} + {{ $custom_template := resources.Get . }} + {{ if $custom_template }} + {{ $custom_style := $custom_template | resources.ToCSS | resources.Minify }} + <link rel="stylesheet" href="{{ $custom_style.RelPermalink }}"> + {{ end }} +{{ end }} +{{ end }}
\ No newline at end of file |