add: added error message when customCSS not exist
This commit is contained in:
parent
bd3ab84db8
commit
2259c04f32
@ -59,8 +59,17 @@
|
|||||||
|
|
||||||
{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
|
{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
|
||||||
{{ range site.Params.customCSS }}
|
{{ range site.Params.customCSS }}
|
||||||
{{ with resources.Get . | toCSS $opts | minify | fingerprint }}
|
{{ $r := "" }}
|
||||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
{{ with resources.Get . }}
|
||||||
|
{{ $r = . }}
|
||||||
|
{{ else }}
|
||||||
|
{{ errorf "error: You defined customCSS, but %s was not found, please check your config." . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if $r}}
|
||||||
|
{{ with $r | toCSS $opts | minify | fingerprint }}
|
||||||
|
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user