Use relative URLs in the baseof template

This commit is contained in:
Eryn Wells 2022-10-19 07:36:18 -07:00
parent 17af243a96
commit c733b6d1aa

View file

@ -16,35 +16,37 @@
<style>
@font-face {
font-family: "Museo_Slab";
src: url("{{ `/fonts/Museo_Slab_500.woff2` | absURL }}") format("woff2"),
url("{{ `/fonts/Museo_Slab_500.woff` | absURL }}") format("woff");
src: url("{{ `/fonts/Museo_Slab_500.woff2` | relURL }}") format("woff2"),
url("{{ `/fonts/Museo_Slab_500.woff` | relURL }}") format("woff");
font-weight: normal;
font-style: normal;
}
</style>
<link rel="stylesheet" as="style" href="{{ `/styles/root.css` | absURL }}">
{{ if not hugo.IsProduction }}
<link rel="stylesheet" as="style" href="/styles/development.css">
{{ end }}
{{ block "styles" . }}{{ end }}
<link rel="stylesheet" as="style" href="{{ `/styles/root.css` | relURL }}">
{{- if not hugo.IsProduction -}}
<link rel="stylesheet" as="style" href="{{ `/styles/development.css` | relURL }}">
{{- 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 }}">
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}">
{{- end -}}
{{- end -}}
{{- end -}}
{{- range .Resources.Match "*.css" -}}
{{- if not (in $includedCSS .Permalink) -}}
{{- $includedCSS = $includedCSS | append .Permalink -}}
<link rel="stylesheet" as="style" href="{{ .Permalink }}">
<link rel="stylesheet" as="style" href="{{ .RelPermalink }}">
{{- end -}}
{{- end -}}
{{ block "styles" . }}{{ end }}
{{ block "scripts" . }}{{ end }}
<script src="{{ `scripts/site.js` | absURL }}"></script>
<script src="{{ `scripts/site.js` | relURL }}"></script>
</html>