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,11 +1,9 @@
<ul>
<li>
<a
href="https://creativecommons.org/publicdomain/zero/1.0/"
<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."
>
aria-label="CC0: This work has been marked as dedicated to the public domain.">
{{ partial "cc.svg" . }}
{{ partial "zero.svg" . }}
</a>

View file

@ -5,12 +5,10 @@
<link rel="stylesheet" href="{{ .RelPermalink }}" />
{{- else }}
{{- with . | minify | fingerprint }}
<link
rel="stylesheet"
<link rel="stylesheet"
href="{{ .RelPermalink }}"
integrity="{{ .Data.Integrity }}"
crossorigin="anonymous"
/>
crossorigin="anonymous" />
{{- end }}
{{- end }}
{{- end }}

View file

@ -8,11 +8,9 @@
{{- with . | js.Build
$opts | fingerprint
}}
<script
src="{{ .RelPermalink }}"
<script src="{{ .RelPermalink }}"
integrity="{{- .Data.Integrity }}"
crossorigin="anonymous"
></script>
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,7 +9,6 @@
*/}}
{{- $page := .page }}
{{- $menuID := .menuID }}
{{- with index site.Menus $menuID }}
<nav>
<ul>
@ -17,7 +16,6 @@
</ul>
</nav>
{{- end }}
{{- define "partials/inline/menu/walk.html" }}
{{- $page := .page }}
{{- range .menuEntries }}
@ -34,14 +32,11 @@
{{- end }}
{{- end }}
<li>
<a
{{- range $k, $v := $attrs }}
<a {{- range $k, $v := $attrs }}
{{- with $v }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end -}}
>{{ $name }}</a
>
{{- end -}}>{{ $name }}</a>
{{- with .Children }}
<ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}

View file

@ -14,7 +14,9 @@
<li>Tags:</li>
<ul>
{{- range . }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
<li>
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</li>
{{- end }}
</ul>
</ul>

View file

@ -1,15 +1,16 @@
<!doctype html>
<html
lang="{{ or site.Language.LanguageCode site.Language.Lang }}"
dir="{{ or site.Language.LanguageDirection `ltr` }}"
>
<head>
{{ partial "head.html" . }}
</head>
<!DOCTYPE html>
<html lang="{{ or site.Language.LanguageCode site.Language.Lang }}"
dir="{{ or site.Language.LanguageDirection `ltr` }}">
<head>{{ partial "head.html" . }}</head>
<body>
<header>{{ partial "header.html" . }}</header>
<main>{{ block "main" . }}{{ end }}</main>
<footer>{{ partial "footer.html" . }}</footer>
<header>
{{ partial "header.html" . }}
</header>
<main>
{{ block "main" . }}{{ end }}
</main>
<footer>
{{ partial "footer.html" . }}
</footer>
</body>
</html>

View file

@ -6,9 +6,7 @@
<li>
<a href="{{ .RelPermalink }}" style="display: block">
<h2>{{ .Title }}</h2>
<p class="lead">{{ .Description }}</p>
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := .Date | time.Format ":date_long" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>

View file

@ -7,11 +7,11 @@
<div class="dates">
<p>
Editiert:
<time datetime="{{ $lastmodDateMachine }}"
>{{ $lastmodDateHuman }}</time
>
<time datetime="{{ $lastmodDateMachine }}">{{ $lastmodDateHuman }}</time>
</p>
<p>
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
</p>
<p><time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time></p>
</div>
<h1>{{ .Title }}</h1>
<p class="lead">{{ .Description }}</p>

View file

@ -1,26 +1,10 @@
{ pkgs, ... }:
{
programs = {
nixfmt.enable = true;
gofmt.enable = true;
taplo.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";
}
];
};
};
djlint.enable = true;
};
settings.global.excludes = [
"archetypes/**"
"public/**"
"static/**"
".envrc"