hugo-owu-se/layouts/partials/custom_head.html

22 lines
1.3 KiB
HTML
Raw Normal View History

2024-03-10 15:27:36 +00:00
{{ if (.Eq (site.GetPage "/")) }}
2024-03-12 09:12:11 +00:00
{{- $randomize := (resources.Get "js/randomize.js" ) }}
{{- $image_array := (resources.Get "js/image-array.js" ) }}
{{- $text_array := (resources.Get "js/text-array.js" )}}
{{- $randomize_combined := slice $image_array $text_array $randomize | resources.Concat "js/random.js" | resources.Minify }}
2024-03-10 15:27:36 +00:00
{{- if not site.Params.assets.disableFingerprinting }}
2024-03-12 09:12:11 +00:00
{{- $randomize_combined := $randomize_combined | fingerprint }}
2024-03-14 06:02:17 +00:00
<script defer crossorigin="anonymous" src="{{ $randomize_combined.RelPermalink }}" integrity="{{ $randomize_combined.Data.Integrity }}"></script>
2024-03-10 15:27:36 +00:00
{{ else }}
2024-03-14 06:02:17 +00:00
<script defer crossorigin="anonymous" src="{{ $randomize_combined.RelPermalink }}"></script>
2024-03-10 15:27:36 +00:00
{{ end }}
{{ end }}
{{- /* specials CSS stylesheet */}}
{{- $special_stylesheet := (resources.Get "css/specials.css") | resources.Minify }}
{{- if not site.Params.assets.disableFingerprinting }}
{{- $special_stylesheet := $special_stylesheet | fingerprint }}
<link crossorigin="anonymous" href="{{ $special_stylesheet.RelPermalink }}" integrity="{{ $special_stylesheet.Data.Integrity }}" rel="preload stylesheet" as="style">
{{ else }}
<link crossorigin="anonymous" href="{{ $special_stylesheet.RelPermalink }}" rel="preload stylesheet" as="style">
{{ end }}