head: commonize stylesheet resource

This commit is contained in:
Aditya Telange 2020-12-07 22:59:51 +05:30
parent 91bc0acfa9
commit 08e58f5f77
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77

View File

@ -21,12 +21,12 @@
<meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" />
{{- end}}
<!-- Styles -->
{{- $stylesheet := (resources.Match "css/*.css") | resources.Concat "assets/css/stylesheet.css" | minify -}}
{{- if not .Site.Params.assets.disableFingerprinting }}
{{- $stylesheet := (resources.Match "css/*.css") | resources.Concat "assets/css/stylesheet.css" | minify | fingerprint -}}
{{- $stylesheet := $stylesheet | fingerprint -}}
<link href="{{ $stylesheet.Permalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet"
as="style">
{{- else}}
{{- $stylesheet := (resources.Match "css/*.css") | resources.Concat "assets/css/stylesheet.css" | minify -}}
<link href="{{ $stylesheet.Permalink }}" rel="preload stylesheet" as="style">
{{- end}}
<!-- Search -->