🎨 Format partials

master
Maxim Lebedev 6 months ago
parent c9921c77ef
commit 6098259eb7
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
  1. 13
      layouts/partials/body.html
  2. 30
      layouts/partials/head.html
  3. 4
      layouts/partials/script.html
  4. 4
      layouts/partials/style.html

@ -1,10 +1,9 @@
{{- with partialCached "va/script" . -}}
<script
async
crossorigin="anonymous"
defer
integrity="{{ .Data.Integrity }}"
<script type="{{ .MediaType.String }}"
src="{{ .RelPermalink }}"
type="{{ .MediaType.String }}">
integrity="{{ . }}"
crossorigin="anonymous"
async
defer>
</script>
{{ end }}
{{- end -}}

@ -1,22 +1,20 @@
{{ with partialCached "va/style" . }}
<link
{{- with partialCached "va/style" . -}}
<link rel="preload stylesheet"
as="style"
crossorigin="anonymous"
href="{{ .RelPermalink }}"
importance="high"
integrity="{{ .Data.Integrity }}"
referrerpolicy="no-referrer-when-downgrade"
rel="preload stylesheet"
type="{{ .MediaType.String }}">
{{ end }}
{{ with partialCached "va/script" . }}
<link
as="script"
type="{{ .MediaType.String }}"
importance="high"
crossorigin="anonymous"
referrerpolicy="no-referrer-when-downgrade">
{{- end -}}
{{- with partialCached "va/script" . -}}
<link rel="preload"
as="script"
href="{{ .RelPermalink }}"
importance="high"
integrity="{{ .Data.Integrity }}"
referrerpolicy="no-referrer-when-downgrade"
rel="preload"
type="{{ .MediaType.String }}">
{{ end }}
type="{{ .MediaType.String }}"
importance="high"
crossorigin="anonymous"
referrerpolicy="no-referrer-when-downgrade">
{{- end -}}

@ -1,12 +1,16 @@
{{- $scripts := slice -}}
{{- range $index, $name := slice
"cover"
"reel"
-}}
{{- $scripts = $scripts | append (resources.Get (printf "va/js/%s.js" $name)) -}}
{{- end -}}
{{- $script := $scripts | resources.Concat "va.js" | js.Build "va.js" -}}
{{- if hugo.IsProduction -}}
{{- $script = $script | minify | fingerprint "sha512" -}}
{{- end -}}
{{- return $script -}}

@ -1,4 +1,5 @@
{{- $styles := slice -}}
{{- range $index, $name := slice
"reset"
"variables"
@ -20,8 +21,11 @@
-}}
{{- $styles = $styles | append (resources.Get (printf "va/css/%s.css" $name)) -}}
{{- end -}}
{{- $style := $styles | resources.Concat "va.css" -}}
{{- if hugo.IsProduction -}}
{{- $style = $style | minify | fingerprint "sha512" -}}
{{- end -}}
{{- return $style -}}

Loading…
Cancel
Save