diff --git a/src/layouts/_default/baseof.html b/src/layouts/_default/baseof.html index 53189319e..43f338ab2 100644 --- a/src/layouts/_default/baseof.html +++ b/src/layouts/_default/baseof.html @@ -20,6 +20,5 @@ {{ partial "footer" . }} - {{ partial "scripts" . }} diff --git a/src/layouts/partials/analytics.html b/src/layouts/partials/analytics.html index 7bc14907b..c238a6276 100644 --- a/src/layouts/partials/analytics.html +++ b/src/layouts/partials/analytics.html @@ -1 +1 @@ - + diff --git a/src/layouts/partials/author-info.html b/src/layouts/partials/author-info.html index ca685a158..c076ec5a9 100644 --- a/src/layouts/partials/author-info.html +++ b/src/layouts/partials/author-info.html @@ -13,8 +13,8 @@ @{{ $author }} diff --git a/src/layouts/partials/head.html b/src/layouts/partials/head.html index b1b5f1713..890ceb095 100644 --- a/src/layouts/partials/head.html +++ b/src/layouts/partials/head.html @@ -1,8 +1,8 @@ - - + + @@ -24,4 +24,7 @@ {{ partial "stylesheet" . -}} {{ partial "favicons" . -}} {{ partial "social" . -}} +{{ partial "scripts" . -}} +{{- if hugo.IsProduction }} {{ partial "analytics" . -}} +{{- end }} diff --git a/src/layouts/partials/scripts.html b/src/layouts/partials/scripts.html index a07e7f697..7552d1f43 100644 --- a/src/layouts/partials/scripts.html +++ b/src/layouts/partials/scripts.html @@ -4,16 +4,15 @@ {{- $esbuildOptions = merge $esbuildOptions (dict "minify" "true") -}} {{- end -}} -{{- $bootstrapJs := resources.Get "/js/vendor/bootstrap.bundle.min.js" | fingerprint | resources.Copy "/assets/js/vendor/bootstrap.bundle.min.js" -}} +{{- $bootstrapJs := resources.Get "js/vendor/bootstrap.bundle.min.js" | fingerprint | resources.Copy "/assets/js/vendor/bootstrap.bundle.min.js" }} {{- $scripts := slice "js/application.js" "js/lazyload.js" -}} {{- range $scriptFile := $scripts -}} -{{- $script := resources.Get $scriptFile | js.Build $esbuildOptions | fingerprint | resources.Copy (path.Join "/assets" $scriptFile) -}} - +{{- $script := resources.Get $scriptFile | js.Build $esbuildOptions | fingerprint | resources.Copy (path.Join "/assets" $scriptFile) }} -{{- end -}} +{{- end }} -{{ range .Page.Params.extra_js -}} +{{- range .Page.Params.extra_js }} -{{- end -}} +{{- end }} diff --git a/src/layouts/partials/stylesheet.html b/src/layouts/partials/stylesheet.html index e70056e44..4f4805f03 100644 --- a/src/layouts/partials/stylesheet.html +++ b/src/layouts/partials/stylesheet.html @@ -1,10 +1,9 @@ -{{ $sassOptions := dict "targetPath" "/assets/css/style.css" "outputStyle" "expanded" "precision" 6 -}} +{{- $sassOptions := dict "targetPath" "/assets/css/style.css" "outputStyle" "expanded" "precision" 6 -}} {{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}} {{- if hugo.IsProduction -}} {{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}} {{- end -}} -{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions | postCSS $postcssOptions | fingerprint -}} - +{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions | postCSS $postcssOptions | fingerprint }}