switch to managing CSS and JS as assets
All checks were successful
Website build and deploy / build (push) Successful in 1m11s
All checks were successful
Website build and deploy / build (push) Successful in 1m11s
This commit is contained in:
21
themes/hugo-sustain/layouts/partials/head/css.html
Normal file
21
themes/hugo-sustain/layouts/partials/head/css.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!-- Static, third-party CSS -->
|
||||
{{- range (slice "css/bootstrap-3.3.7.min.css" "css/fontawesome-all.min.css") }}
|
||||
{{- with resources.Get . }}
|
||||
{{- if eq hugo.Environment "development" }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}">
|
||||
{{- else }}
|
||||
{{- with . | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
<!-- Theme stylesheet, combination of all in assets/scss -->
|
||||
{{- $style := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "scss/main.scss" . | toCSS (dict "targetPath" "css/main.css" "enableSourceMap" false) }}
|
||||
<link rel="stylesheet" href="{{ ($style).RelPermalink }}?v={{ md5 time.Now.Unix }}">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
{{- range .Site.Params.custom_css }}
|
||||
<link rel="stylesheet" href="{{ relURL . }}?v={{ md5 time.Now.Unix }}" />
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user