Swap prettier for djlint

This commit is contained in:
Jan Kremer 2026-02-26 07:35:56 +01:00
parent e2fd2a13e8
commit 212ca46616
No known key found for this signature in database
12 changed files with 150 additions and 178 deletions

View file

@ -1,27 +1,25 @@
<ul>
<li>
<a
href="https://creativecommons.org/publicdomain/zero/1.0/"
target="_blank"
rel="noopener noreferrer"
aria-label="CC0: This work has been marked as dedicated to the public domain."
>
{{ partial "cc.svg" . }}
{{ partial "zero.svg" . }}
</a>
</li>
<li>
<a href="/about" id="title">
{{ partial "logo.svg" . }}
{{ site.Title }}
</a>
</li>
<!-- <li>
{{ with .GitInfo }}
<a href="https://github.com/jukremer/jukremer.github.io/commit/{{ .Hash }}">
{{ partial "git.svg" }} {{ .Subject }} ({{ .AbbreviatedHash }})
</a>
{{ end }}
</li> -->
<li>2021{{ now.Year }}</li>
<li>
<a href="https://creativecommons.org/publicdomain/zero/1.0/"
target="_blank"
rel="noopener noreferrer"
aria-label="CC0: This work has been marked as dedicated to the public domain.">
{{ partial "cc.svg" . }}
{{ partial "zero.svg" . }}
</a>
</li>
<li>
<a href="/about" id="title">
{{ partial "logo.svg" . }}
{{ site.Title }}
</a>
</li>
<!-- <li>
{{ with .GitInfo }}
<a href="https://github.com/jukremer/jukremer.github.io/commit/{{ .Hash }}">
{{ partial "git.svg" }} {{ .Subject }} ({{ .AbbreviatedHash }})
</a>
{{ end }}
</li> -->
<li>2021{{ now.Year }}</li>
</ul>

View file

@ -10,18 +10,18 @@
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<title>
{{ if .IsHome }}
{{ if .IsHome }}
{{ site.Title }}
{{ else }}
{{ else }}
{{ printf "%s %s" .Title
site.Title
site.Title
}}
{{ end }}
{{ end }}
</title>
{{ partialCached "head/css.html" . }}
{{ partialCached "head/js.html" . }}
{{ with .OutputFormats.Get "rss" }}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}{{ with .OutputFormats.Get "atom" }}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}

View file

@ -1,16 +1,14 @@
{{- with resources.Get "css/main.css" }}
{{- if eq hugo.Environment
"development"
}}
<link rel="stylesheet" href="{{ .RelPermalink }}" />
{{- else }}
{{- with . | minify | fingerprint }}
<link
rel="stylesheet"
href="{{ .RelPermalink }}"
integrity="{{ .Data.Integrity }}"
crossorigin="anonymous"
/>
{{- end }}
{{- end }}
{{- if eq hugo.Environment
"development"
}}
<link rel="stylesheet" href="{{ .RelPermalink }}" />
{{- else }}
{{- with . | minify | fingerprint }}
<link rel="stylesheet"
href="{{ .RelPermalink }}"
integrity="{{ .Data.Integrity }}"
crossorigin="anonymous" />
{{- end }}
{{- end }}
{{- end }}

View file

@ -1,18 +1,16 @@
{{- with resources.Get "js/main.js" }}
{{- if eq hugo.Environment "development" }}
{{- with . | js.Build }}
<script src="{{ .RelPermalink }}"></script>
{{- end }}
{{- else }}
{{- $opts := dict "minify" true }}
{{- with . | js.Build
$opts | fingerprint
}}
<script
src="{{ .RelPermalink }}"
integrity="{{- .Data.Integrity }}"
crossorigin="anonymous"
></script>
{{- end }}
{{- end }}
{{- if eq hugo.Environment "development" }}
{{- with . | js.Build }}
<script src="{{ .RelPermalink }}"></script>
{{- end }}
{{- else }}
{{- $opts := dict "minify" true }}
{{- with . | js.Build
$opts | fingerprint
}}
<script src="{{ .RelPermalink }}"
integrity="{{- .Data.Integrity }}"
crossorigin="anonymous"></script>
{{- end }}
{{- end }}
{{- end }}

View file

@ -1,4 +1,2 @@
<a href="/" class="title">
{{ partial "logo.svg" . }}{{ site.Title }}
</a>
<a href="/" class="title">{{ partial "logo.svg" . }}{{ site.Title }}</a>
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}

View file

@ -9,44 +9,39 @@
*/}}
{{- $page := .page }}
{{- $menuID := .menuID }}
{{- with index site.Menus $menuID }}
<nav>
<nav>
<ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
</nav>
</nav>
{{- end }}
{{- define "partials/inline/menu/walk.html" }}
{{- $page := .page }}
{{- range .menuEntries }}
{{- $attrs := dict "href" .URL }}
{{- if $page.IsMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
{{- else if $page.HasMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
{{- end }}
{{- $name := .Name }}
{{- with .Identifier }}
{{- with T . }}
{{- $name = . }}
{{- end }}
{{- end }}
<li>
<a
{{- range $k, $v := $attrs }}
{{- with $v }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end -}}
>{{ $name }}</a
>
{{- with .Children }}
<ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
{{- end }}
</li>
{{- end }}
{{- $page := .page }}
{{- range .menuEntries }}
{{- $attrs := dict "href" .URL }}
{{- if $page.IsMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
{{- else if $page.HasMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
{{- end }}
{{- $name := .Name }}
{{- with .Identifier }}
{{- with T . }}
{{- $name = . }}
{{- end }}
{{- end }}
<li>
<a {{- range $k, $v := $attrs }}
{{- with $v }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end -}}>{{ $name }}</a>
{{- with .Children }}
<ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
{{- end }}
</li>
{{- end }}
{{- end }}

View file

@ -6,17 +6,19 @@
{{- $page := .page }}
{{- $taxonomy := .taxonomy }}
{{- with $page.GetTerms
$taxonomy
$taxonomy
}}
{{- $label := (index . 0).Parent.LinkTitle }}
<div class="tags">
{{- $label := (index . 0).Parent.LinkTitle }}
<div class="tags">
<ul>
<li>Tags:</li>
<ul>
{{- range . }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{- end }}
</ul>
<li>Tags:</li>
<ul>
{{- range . }}
<li>
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</li>
{{- end }}
</ul>
</ul>
</div>
</div>
{{- end }}