Update template for more recent Hugo

This commit is contained in:
Amolith 2024-09-30 15:46:39 -06:00
parent 52762fb14a
commit ab658a8750
Signed by: Amolith
SSH Key Fingerprint: SHA256:JBKEeoO/72Fz03rtlzeO49PATFT2maMancH3opcT0h0
1 changed files with 14 additions and 5 deletions

View File

@ -38,11 +38,20 @@
<meta property="og:image" content="{{ if .IsHome }}{{ .Site.Params.cover }}{{ else }}{{ .Params.Cover }}{{ end }}" /> <meta property="og:image" content="{{ if .IsHome }}{{ .Site.Params.cover }}{{ else }}{{ .Params.Cover }}{{ end }}" />
<!-- Styles --> <!-- Styles -->
{{ $options := (dict "outputStyle" "compressed" "enableSourceMap" true) }} {{ with resources.Get "scss/imports.scss" }}
{{ $scss := resources.Get "scss/imports.scss" }} {{ $opts := dict "outputStyle" "compressed" "enabledSourceMap" true "transpiler" "libsass" "targetPath" "css/style.css" }}
{{ $style := $scss | resources.ToCSS $options }} {{ with . | toCSS $opts }}
<link rel="preload" href="{{ $style.RelPermalink }}?{{ now.Unix }}" as="style"> {{ if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}?{{ now.Unix }}"> <link rel="preload" href="{{ .RelPermalink }}" as="style">
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{ else }}
{{ with . | minify | fingerprint }}
<link rel="preload" href="{{ .RelPermalink }}" as="style">
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ partialCached "favicons.html" . }} {{ partialCached "favicons.html" . }}