forked from drowl87/hextra_mirror
chore: proper dev and prod styles handling
This commit is contained in:
parent
283c7daaf2
commit
c0d15f89e8
@ -1,14 +1,25 @@
|
|||||||
{{ if and (not hugo.IsProduction) (eq hugo.Environment "theme")}}
|
{{- if and (not hugo.IsProduction) (eq hugo.Environment "theme") }}
|
||||||
{{ $styles := resources.Get "css/styles.css" }}
|
{{- $styles := resources.Get "css/styles.css" }}
|
||||||
{{ $styles = $styles | resources.PostCSS (dict "inlineImports" true) }}
|
{{- $styles = $styles | resources.PostCSS (dict "inlineImports" true) }}
|
||||||
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
||||||
{{ else }}
|
{{- else }}
|
||||||
{{ $styles := resources.Get "css/compiled/main.css" }}
|
{{- $styles := resources.Get "css/compiled/main.css" -}}
|
||||||
{{ $styles = $styles | minify | fingerprint | resources.PostProcess }}
|
|
||||||
|
{{- if hugo.IsProduction }}
|
||||||
|
{{- $styles = $styles | minify | fingerprint }}
|
||||||
<link rel="preload" href="{{ $styles.RelPermalink }}" as="style" />
|
<link rel="preload" href="{{ $styles.RelPermalink }}" as="style" />
|
||||||
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" integrity="{{ $styles.Data.Integrity }}" />
|
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" integrity="{{ $styles.Data.Integrity }}" />
|
||||||
{{ end }}
|
{{- else }}
|
||||||
|
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{ $custom := resources.Get "css/custom.css" }}
|
|
||||||
{{ $custom = $custom | minify | fingerprint }}
|
<!-- 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 }}" />
|
<link href="{{ $custom.RelPermalink }}" rel="stylesheet" integrity="{{ $custom.Data.Integrity }}" />
|
||||||
|
{{- else }}
|
||||||
|
<link href="{{ $custom.RelPermalink }}" rel="stylesheet" />
|
||||||
|
{{- end }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user