hextra/layouts/partials/head-css.html

26 lines
1.0 KiB
HTML

{{- if and (not hugo.IsProduction) (eq hugo.Environment "theme") }}
{{- $styles := resources.Get "css/styles.css" }}
{{- $styles = $styles | postCSS (dict "inlineImports" true) }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
{{- else }}
{{- $styles := resources.Get "css/compiled/main.css" -}}
{{- if hugo.IsProduction }}
{{- $styles = $styles | minify | fingerprint }}
<link rel="preload" href="{{ $styles.RelPermalink }}" as="style" integrity="{{ $styles.Data.Integrity }}" />
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" integrity="{{ $styles.Data.Integrity }}" />
{{- else }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
{{- end }}
{{- end }}
<!-- Custom CSS -->
{{- $custom := resources.Get "css/custom.css" }}
{{- if hugo.IsProduction -}}
{{- $custom = $custom | minify | fingerprint }}
<link href="{{ $custom.RelPermalink }}" rel="stylesheet" integrity="{{ $custom.Data.Integrity }}" />
{{- else }}
<link href="{{ $custom.RelPermalink }}" rel="stylesheet" />
{{- end }}