Make sure CSS files are only included once
This commit is contained in:
parent
9db95c7bb0
commit
9e72b74200
1 changed files with 16 additions and 8 deletions
|
@ -28,14 +28,22 @@
|
|||
<link rel="stylesheet" as="style" href="/styles/development.css">
|
||||
{{ end }}
|
||||
{{ block "styles" . }}{{ end }}
|
||||
{{ if not .FirstSection.IsHome }}
|
||||
{{ range .FirstSection.Resources.Match "*.css" }}
|
||||
<link rel="stylesheet" as="style" href="{{ .Permalink }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range .Resources.Match "*.css" }}
|
||||
<link rel="stylesheet" as="style" href="{{ .Permalink }}">
|
||||
{{ end }}
|
||||
|
||||
{{- $includedCSS := slice -}}
|
||||
{{- if not .FirstSection.IsHome -}}
|
||||
{{- range .FirstSection.Resources.Match "*.css" -}}
|
||||
{{- if not (in $includedCSS .Permalink) -}}
|
||||
{{- $includedCSS = $includedCSS | append .Permalink -}}
|
||||
<link rel="stylesheet" as="style" href="{{ .Permalink }}">
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- range .Resources.Match "*.css" -}}
|
||||
{{- if not (in $includedCSS .Permalink) -}}
|
||||
{{- $includedCSS = $includedCSS | append .Permalink -}}
|
||||
<link rel="stylesheet" as="style" href="{{ .Permalink }}">
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ block "scripts" . }}{{ end }}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue