LoveIt/layouts/partials/plugin/stylesheet.html
Dillon 90184ca3e7
feat(search): add local search (#231)
* feat(search): add local search

* docs: add docs for search
2020-04-15 15:46:50 +08:00

25 lines
1.1 KiB
HTML

{{- if strings.HasPrefix .source "<link" -}}
{{- safeHTML .source -}}
{{- else -}}
{{- $href := .source -}}
{{- $integrity := .integrity -}}
{{- if strings.HasPrefix $href "http" | not -}}
{{- $res := resources.Get $href -}}
{{- with .template -}}
{{- $res = $res | resources.ExecuteAsTemplate . $.context -}}
{{- end -}}
{{- with .toCSS -}}
{{- $options := . | merge (dict "outputStyle" "compressed" "enableSourceMap" true) -}}
{{- $res = $res | toCSS $options -}}
{{- end -}}
{{- if .minify -}}
{{- $res = $res | minify -}}
{{- end -}}
{{- with .fingerprint -}}
{{- $res = $res | fingerprint . -}}
{{- $integrity = $res.Data.Integrity -}}
{{- end -}}
{{- $href = $res.RelPermalink -}}
{{- end -}}
<link rel="stylesheet" href="{{ $href }}"{{ if .crossorigin }} crossorigin="anonymous"{{ end }}{{ with $integrity }} integrity="{{ . }}"{{ end }}{{ with .attr }} {{ . | safeHTMLAttr }}{{ end }}>
{{- end -}}