diff --git a/layouts/_default/home.html b/layouts/_default/home.html
index 4461906..535931a 100644
--- a/layouts/_default/home.html
+++ b/layouts/_default/home.html
@@ -1,14 +1,19 @@
-{{ define "main" }} {{ .Content }} {{ $pages := .Paginate (where
-.Site.RegularPages "Type" "ne" "page") }} {{ range $pages.Pages }}
-
-
+
+ {{ end }}
+{{ end }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index fc5a025..28e9dc2 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,13 +1,16 @@
-{{ define "main" }} {{ .Content }} {{ range .Pages }}
-
-
+
+ {{ end }}
+{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 5a75550..f388f71 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,14 +1,15 @@
{{ define "main" }}
-
- {{ $dateMachine := .Lastmod | time.Format "2006-01-02T15:04:05-07:00" }} {{
- $dateHuman := .Lastmod | time.Format "2006-01-02" }}
-
-
+
+ {{ $dateMachine := .Lastmod | time.Format "2006-01-02T15:04:05-07:00" }}
+ {{ $dateHuman := .Lastmod | time.Format "2006-01-02" }}
+
+
- {{ .Title }}
+ {{ .Title }}
- {{ .Description }}
+ {{ .Description }}
- {{ .Content }}
-
-{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} {{ end }}
+ {{ .Content }}
+
+ {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
+{{ end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index ee7fdf7..c63f8ea 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -5,10 +5,18 @@
- {{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s – %s" .Title
- site.Title }}{{ end }}
+ {{ if .IsHome }}
+ {{ site.Title }}
+ {{ else }}
+ {{ printf "%s – %s" .Title
+ site.Title
+ }}
+ {{ end }}
-{{ partialCached "head/css.html" . }} {{ partialCached "head/js.html" . }} {{
-partial "head/analytics.html" . }} {{ with .OutputFormats.Get "rss" -}} {{
-printf `` .Rel .MediaType.Type
-.Permalink site.Title | safeHTML }} {{ end }}
+{{ partialCached "head/css.html" . }} {{ partialCached "head/js.html" . }}
+{{ partial "head/analytics.html" . }}
+{{ with .OutputFormats.Get "rss" -}}
+ {{ printf `` .Rel .MediaType.Type
+ .Permalink site.Title | safeHTML
+ }}
+{{ end }}
diff --git a/layouts/partials/head/analytics.html b/layouts/partials/head/analytics.html
index 487d31f..cc44d3a 100644
--- a/layouts/partials/head/analytics.html
+++ b/layouts/partials/head/analytics.html
@@ -1,7 +1,7 @@
{{ if hugo.IsProduction }}
-
+
{{ end }}
diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html
index 36cbbb4..4c1c0a1 100644
--- a/layouts/partials/head/css.html
+++ b/layouts/partials/head/css.html
@@ -1,11 +1,16 @@
-{{- with resources.Get "css/main.css" }} {{- if eq hugo.Environment
-"development" }}
-
-{{- else }} {{- with . | minify | fingerprint }}
-
-{{- end }} {{- end }} {{- end }}
+{{- with resources.Get "css/main.css" }}
+ {{- if eq hugo.Environment
+ "development"
+ }}
+
+ {{- else }}
+ {{- with . | minify | fingerprint }}
+
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html
index 14ef07b..cf3c3c1 100644
--- a/layouts/partials/head/js.html
+++ b/layouts/partials/head/js.html
@@ -1,11 +1,18 @@
-{{- with resources.Get "js/main.js" }} {{- if eq hugo.Environment "development"
-}} {{- with . | js.Build }}
-
-{{- end }} {{- else }} {{- $opts := dict "minify" true }} {{- with . | js.Build
-$opts | fingerprint }}
-
-{{- end }} {{- end }} {{- end }}
+{{- with resources.Get "js/main.js" }}
+ {{- if eq hugo.Environment "development" }}
+ {{- with . | js.Build }}
+
+ {{- end }}
+ {{- else }}
+ {{- $opts := dict "minify" true }}
+ {{- with . | js.Build
+ $opts | fingerprint
+ }}
+
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html
index 7183180..c23f626 100644
--- a/layouts/partials/menu.html
+++ b/layouts/partials/menu.html
@@ -1,12 +1,12 @@
{{- /*
-Renders a menu for the given menu ID.
+ Renders a menu for the given menu ID.
-@context {page} page The current page.
-@context {string} menuID The menu ID.
+ @context {page} page The current page.
+ @context {string} menuID The menu ID.
-@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
+ @example: {{ partial "menu.html" (dict "menuID" "main" "page" .)
+}}
*/}}
-
{{- $page := .page }}
{{- $menuID := .menuID }}
@@ -24,7 +24,7 @@ Renders a menu for the given menu ID.
{{- $attrs := dict "href" .URL }}
{{- if $page.IsMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
- {{- else if $page.HasMenuCurrent .Menu .}}
+ {{- else if $page.HasMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
{{- end }}
{{- $name := .Name }}
@@ -40,7 +40,8 @@ Renders a menu for the given menu ID.
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end -}}
- >{{ $name }}
+ >{{ $name }}
{{- with .Children }}
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
diff --git a/layouts/partials/terms.html b/layouts/partials/terms.html
index 6b15311..1c16978 100644
--- a/layouts/partials/terms.html
+++ b/layouts/partials/terms.html
@@ -1,13 +1,17 @@
{{- /* For a given taxonomy, renders a list of terms assigned to the page.
-@context {page} page The current page. @context {string} taxonomy The taxonony.
-@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} */}} {{-
-$page := .page }} {{- $taxonomy := .taxonomy }} {{- with $page.GetTerms
-$taxonomy }} {{- $label := (index . 0).Parent.LinkTitle }}
-
+ @context {page} page The current page. @context {string} taxonomy The taxonony.
+ @example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .)
+}}
+*/}} {{- $page := .page }} {{- $taxonomy := .taxonomy }}
+{{- with $page.GetTerms
+ $taxonomy
+}}
+ {{- $label := (index . 0).Parent.LinkTitle }}
+
{{- end }}
diff --git a/treefmt.nix b/treefmt.nix
index 51962fe..202f4ed 100644
--- a/treefmt.nix
+++ b/treefmt.nix
@@ -1,9 +1,27 @@
+{ pkgs, ... }:
{
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
gofmt.enable = true;
taplo.enable = true;
- prettier.enable = true;
+ prettier = {
+ enable = true;
+ settings = {
+ plugins = [
+ "${pkgs.prettier-plugin-go-template}/lib/node_modules/prettier-plugin-go-template/lib/index.js"
+ ];
+ overrides = [
+ {
+ files = [ "*.html" ];
+ options.parser = "go-template";
+ }
+ ];
+ };
+ };
};
+ settings.global.excludes = [
+ "public/**"
+ "static/**"
+ ];
}