diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d912354..4cd87a8 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -28,14 +28,22 @@ {{ end }} {{ block "styles" . }}{{ end }} - {{ if not .FirstSection.IsHome }} - {{ range .FirstSection.Resources.Match "*.css" }} - - {{ end }} - {{ end }} - {{ range .Resources.Match "*.css" }} - - {{ end }} + + {{- $includedCSS := slice -}} + {{- if not .FirstSection.IsHome -}} + {{- range .FirstSection.Resources.Match "*.css" -}} + {{- if not (in $includedCSS .Permalink) -}} + {{- $includedCSS = $includedCSS | append .Permalink -}} + + {{- end -}} + {{- end -}} + {{- end -}} + {{- range .Resources.Match "*.css" -}} + {{- if not (in $includedCSS .Permalink) -}} + {{- $includedCSS = $includedCSS | append .Permalink -}} + + {{- end -}} + {{- end -}} {{ block "scripts" . }}{{ end }}