diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 5008fcc..400774c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -62,6 +62,11 @@ disableHugoGeneratorInject = false # Prefix of link to the git commit detail page. GitInfo must be enabled. # gitUrl = "" + # Integrate Javascript files or stylesheets by adding the url to the external assets or by + # linking local files with their path relative to the static folder, e.g. "css/styles.css" + customCSS = [] + customJS = [] + # Toggle this option need to rebuild SCSS, requires extended version of Hugo justifyContent = false # Set "text-align: justify" to .content. diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c7eae1f..c0a4f06 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -28,9 +28,11 @@ {{ $style := resources.Get "scss/main.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }} -{{- range .Site.Params.customCSS }} - -{{- end }} +{{ range $val := $.Site.Params.customCSS }} + {{ if gt (len $val) 0 }} + + {{ end }} +{{ end }} {{- partial "favicons.html" }} diff --git a/layouts/partials/javascript.html b/layouts/partials/javascript.html index e6b0fa0..6d0d7e5 100644 --- a/layouts/partials/javascript.html +++ b/layouts/partials/javascript.html @@ -16,3 +16,9 @@ ga('send', 'pageview'); {{- end}} + +{{ range $val := $.Site.Params.customJS }} + {{ if gt (len $val) 0 }} + + {{ end }} +{{ end }}