hugo/docs/layouts/_partials/helpers/linkcss.html
Bjørn Erik Pedersen 61a286595e
Some checks are pending
Test / test (1.23.x, ubuntu-latest) (push) Waiting to run
Test / test (1.23.x, windows-latest) (push) Waiting to run
Test / test (1.24.x, ubuntu-latest) (push) Waiting to run
Test / test (1.24.x, windows-latest) (push) Waiting to run
Merge commit 'b3d87dd0fd'
2025-04-24 10:23:16 +02:00

28 lines
683 B
HTML

{{ $r := .r }}
{{ $attr := .attributes | default dict }}
{{ if hugo.IsDevelopment }}
<link
rel="stylesheet"
href="{{ $r.RelPermalink }}"
{{ template `render-attributes` $attr }}>
{{ else }}
{{ with $r | minify | fingerprint }}
<link
rel="stylesheet"
href="{{ .RelPermalink }}"
integrity="{{ .Data.Integrity }}"
crossorigin="anonymous"
{{ template `render-attributes` $attr }}>
{{ end }}
{{ end }}
{{ define "render-attributes" }}
{{- range $k, $v := . -}}
{{- if $v -}}
{{- printf ` %s=%q` $k $v | safeHTMLAttr -}}
{{- else -}}
{{- printf ` %s` $k | safeHTMLAttr -}}
{{- end -}}
{{- end -}}
{{ end }}