Merge pull request #50 from cristiandonosoc/fix_ctx_custom_css

Fix context given to customs_css
This commit is contained in:
BLZR
2024-02-02 09:56:05 +05:30
committed by GitHub

View File

@ -1,3 +1,5 @@
{{ $rootCtx := . }}
<!DOCTYPE html>
<html lang="{{.Site.LanguageCode}}">
<head>
@ -14,7 +16,7 @@
{{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}}
<link rel="stylesheet dns-prefetch preconnect preload prefetch" as="style" href="{{ $style.Permalink }}" {{ printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous">
{{- range .Params.custom_css -}}
{{ $c_css := resources.Get . | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}}
{{ $c_css := resources.Get . | resources.ExecuteAsTemplate "css/style.css" $rootCtx | toCSS | minify | fingerprint -}}
<link rel="stylesheet preload prefetch" as="style" href="{{ $c_css.Permalink }}" {{ printf "integrity=%q" $c_css.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous">
{{- end -}}
{{- block "head" . -}}{{- end -}}