mirror of
https://github.com/TrezOne/congo-hindi-gujarati.git
synced 2026-07-17 16:35:46 -04:00
✨ Add asset fingerprinting and SRI
This commit is contained in:
@@ -27,16 +27,35 @@
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
{{/* Styles */}}
|
||||
{{ $cssScheme := resources.Get (printf "css/schemes/%s.css" (.Site.Params.colorScheme | default "congo")) }}
|
||||
{{ if not $cssScheme }}
|
||||
{{ $cssScheme = resources.Get "css/schemes/congo.css" }}
|
||||
{{ $schemeCSS := resources.Get (printf "css/schemes/%s.css" (.Site.Params.colorScheme | default "congo")) }}
|
||||
{{ if not $schemeCSS }}
|
||||
{{ $schemeCSS = resources.Get "css/schemes/congo.css" }}
|
||||
{{ end }}
|
||||
{{ $schemeStyles := $schemeCSS | resources.Minify | resources.Fingerprint "sha512" }}
|
||||
<link
|
||||
type="text/css"
|
||||
rel="stylesheet"
|
||||
href="{{ $schemeStyles.Permalink }}"
|
||||
integrity="{{ $schemeStyles.Data.Integrity }}"
|
||||
/>
|
||||
{{ $mainCSS := resources.Get "css/compiled/main.css" }}
|
||||
{{ $mainStyles := $mainCSS | resources.Minify | resources.Fingerprint "sha512" }}
|
||||
<link
|
||||
type="text/css"
|
||||
rel="stylesheet"
|
||||
href="{{ $mainStyles.Permalink }}"
|
||||
integrity="{{ $mainStyles.Data.Integrity }}"
|
||||
/>
|
||||
{{ $customCSS := resources.Get "css/custom.css" }}
|
||||
{{ if $customCSS }}
|
||||
{{ $customStyles := $customCSS | resources.Minify | resources.Fingerprint "sha512" }}
|
||||
<link
|
||||
type="text/css"
|
||||
rel="stylesheet"
|
||||
href="{{ $customStyles.Permalink }}"
|
||||
integrity="{{ $customStyles.Data.Integrity }}"
|
||||
/>
|
||||
{{ end }}
|
||||
{{ $stylesheet := $cssScheme | resources.Minify }}
|
||||
<link type="text/css" rel="stylesheet" href="{{ $stylesheet.Permalink }}" />
|
||||
<link type="text/css" rel="stylesheet" href="{{ "css/main.css" | absURL }}" />
|
||||
{{ if (fileExists "static/css/custom.css") -}}
|
||||
<link type="text/css" rel="stylesheet" href="{{ "css/custom.css" | absURL }}" />
|
||||
{{- end }}
|
||||
{{/* Icons */}}
|
||||
{{ if templates.Exists "partials/favicons.html" }}
|
||||
{{ partialCached "favicons.html" .Site }}
|
||||
|
||||
Reference in New Issue
Block a user