diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index e8e9f6c..4d1151d 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -16,35 +16,37 @@
-
- {{ if not hugo.IsProduction }}
-
- {{ end }}
- {{ block "styles" . }}{{ end }}
+
+ {{- if not hugo.IsProduction -}}
+
+ {{- 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 "styles" . }}{{ end }}
+
{{ block "scripts" . }}{{ end }}
-
+