4 Commits

Author SHA1 Message Date
daniel b024424405 Add extra_head block. 2026-06-27 17:25:22 +02:00
daniel 0f3258f2db Remove whitespace in meta partial. 2026-06-24 16:10:29 +02:00
daniel 8d367dfa79 Add human file size partial. 2026-06-24 16:10:17 +02:00
daniel bf6ae71511 Ensure context in partial. 2026-06-16 20:54:02 +02:00
4 changed files with 30 additions and 23 deletions
+7
View File
@@ -0,0 +1,7 @@
{{/* Call this with a resource's content e.g., partial "human_file_size" .Content */}}
{{- $bytes := len . -}}
{{- $kb := div $bytes 1024 -}}
{{- $mb := div $kb 1024 -}}
{{- if ge $mb 1 -}}{{- $mb -}} MB
{{- else if ge $kb 1 -}}{{- $kb -}} KB
{{- else -}}{{- $bytes -}} B{{- end -}}
+21 -22
View File
@@ -1,27 +1,26 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} - {{ .Site.Title }}{{ end }}</title>
<meta name="description" content="{{ .Page.Params.description }}"> <meta name="description" content="{{ .Page.Params.description }}">
<meta name="author" content="{{ .Site.Params.author }}"> <meta name="author" content="{{ or .Page.Params.author .Site.Params.author }}">
<meta name="generator" content="{{ hugo.Environment }}"> <meta name="generator" content="gohugo.io; {{ hugo.Environment }}">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="/img/favicon.png"> <link rel="icon" type="image/png" href="/img/favicon.png">
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} - {{ .Site.Title }}{{ end }}</title>
<!-- Compile SCSS to CSS --> <!-- Compile SCSS to CSS -->
{{ with resources.Get "scss/main.scss" }} {{- with resources.Get "scss/main.scss" -}}
{{ $opts := dict {{- $opts := dict
"enableSourceMap" (not hugo.IsProduction) "enableSourceMap" (not hugo.IsProduction)
"outputStyle" (cond hugo.IsProduction "compressed" "expanded") "outputStyle" (cond hugo.IsProduction "compressed" "expanded")
"targetPath" "css/main.css" "targetPath" "css/main.css"
"transpiler" "dartsass" "transpiler" "dartsass"
}} -}}
{{ with . | toCSS $opts }} {{- with . | toCSS $opts -}}
{{ if hugo.IsProduction }} {{- if hugo.IsProduction -}}
{{ with . | fingerprint "sha512" }} {{- with . | fingerprint "sha512" -}}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }} {{- end -}}
{{ else }} {{- else -}}
<link rel="stylesheet" href="{{ .RelPermalink }}"> <link rel="stylesheet" href="{{ .RelPermalink }}">
{{ end }} {{- end -}}
{{ end }} {{- end -}}
{{ end }} {{- end -}}
+1 -1
View File
@@ -11,4 +11,4 @@
<script src="{{ $custom.RelPermalink }}" integrity="{{ $custom.Data.Integrity }}" crossorigin="anonymous"></script> <script src="{{ $custom.RelPermalink }}" integrity="{{ $custom.Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }} {{ end }}
{{ partial "scripts_extra.html "}} {{ partial "scripts_extra.html" . }}
+1
View File
@@ -3,6 +3,7 @@
<head> <head>
{{- partial "meta.html" . -}} {{- partial "meta.html" . -}}
{{- partial "head_extra.html" . -}} {{- partial "head_extra.html" . -}}
{{- block "extra_head" . }}{{ end }}
</head> </head>
<body> <body>
{{- partial "header.html" . -}} {{- partial "header.html" . -}}