paspo cf9b479335 SRI (Subresource Integrity) (#280)
è la cosa per cui i CSS/JS richiamati dall'html hanno un tag con l'hash

fixes #283

Reviewed-on: #280
Co-authored-by: paspo <paolo@asperti.com>
Co-committed-by: paspo <paolo@asperti.com>
2024-10-27 21:48:54 +00:00

15 lines
819 B
HTML

{{ $options := (dict "targetPath" "style.css" "outputStyle" "compressed" "enableSourceMap" .Site.Params.enableSourceMaps) }}
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "main.scss" . | css.Sass $options }}
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
{{ if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ else }}
{{ with $style | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ end }}
{{- partial "head/custom.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}