]> juplo.de Git - website/commitdiff
WIP:thymeleaf
authorKai Moritz <kai@juplo.de>
Sat, 22 Nov 2025 11:20:03 +0000 (12:20 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 28 Nov 2025 11:12:23 +0000 (12:12 +0100)
14 files changed:
hugo/content/_index.md [new file with mode: 0644]
hugo/content/archives.md
hugo/content/index.md [new file with mode: 0644]
hugo/themes/thymeleaf/content/_index.md [deleted file]
hugo/themes/thymeleaf/content/posts/_index.md [deleted file]
hugo/themes/thymeleaf/content/posts/post-1.md [deleted file]
hugo/themes/thymeleaf/content/posts/post-2.md [deleted file]
hugo/themes/thymeleaf/content/posts/post-3/bryce-canyon.jpg [deleted file]
hugo/themes/thymeleaf/content/posts/post-3/index.md [deleted file]
hugo/themes/thymeleaf/layouts/_partials/author.html [new file with mode: 0644]
hugo/themes/thymeleaf/layouts/_partials/header.html
hugo/themes/thymeleaf/layouts/_partials/post_meta.html [new file with mode: 0644]
hugo/themes/thymeleaf/layouts/archives.html [new file with mode: 0644]
hugo/themes/thymeleaf/layouts/baseof.html

diff --git a/hugo/content/_index.md b/hugo/content/_index.md
new file mode 100644 (file)
index 0000000..6580163
--- /dev/null
@@ -0,0 +1,4 @@
+---
+title: Blog
+url: /blog/
+---
index aaadc430a5290e3ca196ba20ef45ac0b8284175c..b94a5f9a83b74b9f10f160460eaf6f1a7a464f2c 100644 (file)
@@ -1,7 +1,7 @@
 
 ---
-title: "All"
+title: "Archives"
 layout: "archives"
-url: "/all/"
-summary: archives
+url: "/archives/"
+summary: Archive of all posts, organized by the publishing date
 ---
diff --git a/hugo/content/index.md b/hugo/content/index.md
new file mode 100644 (file)
index 0000000..cdc0460
--- /dev/null
@@ -0,0 +1,5 @@
+---
+title: Blog
+url: /blog/
+---
+Hallo Welt!
diff --git a/hugo/themes/thymeleaf/content/_index.md b/hugo/themes/thymeleaf/content/_index.md
deleted file mode 100644 (file)
index 652623b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-+++
-title = 'Home'
-date = 2023-01-01T08:00:00-07:00
-draft = false
-+++
-
-Laborum voluptate pariatur ex culpa magna nostrud est incididunt fugiat
-pariatur do dolor ipsum enim. Consequat tempor do dolor eu. Non id id anim anim
-excepteur excepteur pariatur nostrud qui irure ullamco.
diff --git a/hugo/themes/thymeleaf/content/posts/_index.md b/hugo/themes/thymeleaf/content/posts/_index.md
deleted file mode 100644 (file)
index e7066c0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-+++
-title = 'Posts'
-date = 2023-01-01T08:30:00-07:00
-draft = false
-+++
-
-Tempor est exercitation ad qui pariatur quis adipisicing aliquip nisi ea consequat ipsum occaecat. Nostrud consequat ullamco laboris fugiat esse esse adipisicing velit laborum ipsum incididunt ut enim. Dolor pariatur nulla quis fugiat dolore excepteur. Aliquip ad quis aliqua enim do consequat.
diff --git a/hugo/themes/thymeleaf/content/posts/post-1.md b/hugo/themes/thymeleaf/content/posts/post-1.md
deleted file mode 100644 (file)
index 3e3fc6b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-+++
-title = 'Post 1'
-date = 2023-01-15T09:00:00-07:00
-draft = false
-tags = ['red']
-+++
-
-Tempor proident minim aliquip reprehenderit dolor et ad anim Lorem duis sint eiusmod. Labore ut ea duis dolor. Incididunt consectetur proident qui occaecat incididunt do nisi Lorem. Tempor do laborum elit laboris excepteur eiusmod do. Eiusmod nisi excepteur ut amet pariatur adipisicing Lorem.
-
-Occaecat nulla excepteur dolore excepteur duis eiusmod ullamco officia anim in voluptate ea occaecat officia. Cillum sint esse velit ea officia minim fugiat. Elit ea esse id aliquip pariatur cupidatat id duis minim incididunt ea ea. Anim ut duis sunt nisi. Culpa cillum sit voluptate voluptate eiusmod dolor. Enim nisi Lorem ipsum irure est excepteur voluptate eu in enim nisi. Nostrud ipsum Lorem anim sint labore consequat do.
diff --git a/hugo/themes/thymeleaf/content/posts/post-2.md b/hugo/themes/thymeleaf/content/posts/post-2.md
deleted file mode 100644 (file)
index 22b8287..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-+++
-title = 'Post 2'
-date = 2023-02-15T10:00:00-07:00
-draft = false
-tags = ['red','green']
-+++
-
-Anim eiusmod irure incididunt sint cupidatat. Incididunt irure irure irure nisi ipsum do ut quis fugiat consectetur proident cupidatat incididunt cillum. Dolore voluptate occaecat qui mollit laborum ullamco et. Ipsum laboris officia anim laboris culpa eiusmod ex magna ex cupidatat anim ipsum aute. Mollit aliquip occaecat qui sunt velit ut cupidatat reprehenderit enim sunt laborum. Velit veniam in officia nulla adipisicing ut duis officia.
-
-Exercitation voluptate irure in irure tempor mollit Lorem nostrud ad officia. Velit id fugiat occaecat do tempor. Sit officia Lorem aliquip eu deserunt consectetur. Aute proident deserunt in nulla aliquip dolore ipsum Lorem ut cupidatat consectetur sit sint laborum. Esse cupidatat sit sint sunt tempor exercitation deserunt. Labore dolor duis laborum est do nisi ut veniam dolor et nostrud nostrud.
diff --git a/hugo/themes/thymeleaf/content/posts/post-3/bryce-canyon.jpg b/hugo/themes/thymeleaf/content/posts/post-3/bryce-canyon.jpg
deleted file mode 100644 (file)
index 9a923be..0000000
Binary files a/hugo/themes/thymeleaf/content/posts/post-3/bryce-canyon.jpg and /dev/null differ
diff --git a/hugo/themes/thymeleaf/content/posts/post-3/index.md b/hugo/themes/thymeleaf/content/posts/post-3/index.md
deleted file mode 100644 (file)
index ca42a66..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-+++
-title = 'Post 3'
-date = 2023-03-15T11:00:00-07:00
-draft = false
-tags = ['red','green','blue']
-+++
-
-Occaecat aliqua consequat laborum ut ex aute aliqua culpa quis irure esse magna dolore quis. Proident fugiat labore eu laboris officia Lorem enim. Ipsum occaecat cillum ut tempor id sint aliqua incididunt nisi incididunt reprehenderit. Voluptate ad minim sint est aute aliquip esse occaecat tempor officia qui sunt. Aute ex ipsum id ut in est velit est laborum incididunt. Aliqua qui id do esse sunt eiusmod id deserunt eu nostrud aute sit ipsum. Deserunt esse cillum Lorem non magna adipisicing mollit amet consequat.
-
-![Bryce Canyon National Park](bryce-canyon.jpg)
-
-Sit excepteur do velit veniam mollit in nostrud laboris incididunt ea. Amet eu cillum ut reprehenderit culpa aliquip labore laborum amet sit sit duis. Laborum id proident nostrud dolore laborum reprehenderit quis mollit nulla amet veniam officia id id. Aliquip in deserunt qui magna duis qui pariatur officia sunt deserunt.
diff --git a/hugo/themes/thymeleaf/layouts/_partials/author.html b/hugo/themes/thymeleaf/layouts/_partials/author.html
new file mode 100644 (file)
index 0000000..8f2758f
--- /dev/null
@@ -0,0 +1,9 @@
+{{- if or .Params.author site.Params.author }}
+{{- $author := (.Params.author | default site.Params.author) }}
+{{- $author_type := (printf "%T" $author) }}
+{{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }}
+{{- (delimit $author ", " ) }}
+{{- else }}
+{{- $author }}
+{{- end }}
+{{- end -}}
index 7980a00e1e2613fa8adc68e98a99460bd6131422..f2eec4685681108b9aea4cc1d0331acf0fe88005 100644 (file)
@@ -1,2 +1,29 @@
-<h1>{{ site.Title }}</h1>
+<h1 class="short_title">{{ site.Title }}</h1>
+<h2>URI</h2>
+<ul>
+  <li><strong>site:</strong> <code class="site_uri">{{ .RelPermalink }}</code></li>
+  <li><strong>canonical:</strong> <code class="canonical_uri">{{ .Permalink }}</code></li>
+  <li><strong>relative:</strong> <code class="relative_uri">{{ .RelPermalink }}</code></li>
+  <li><strong>logical path:</strong> <code class="logical_path">{{ .Path }}</code></li>
+  <li><strong>logical path:</strong> <code class="logical_path">{{ .Path }}</code></li>
+  <li><strong>.Path:</strong> <code class="logical_path">{{ .Path }}</code></li>
+  <li><strong>.Page.Permalink:</strong> <code class="">{{ .Page.Permalink }}</code></li>
+  <li><strong>.Page.RelPermalink:</strong> <code class="">{{ .Page.RelPermalink }}</code></li>
+  <li><strong>.CurrentSection:</strong> <code class="">{{ .CurrentSection }}</code></li>
+  <li><strong>.Data.Term:</strong> <code class="">{{ .Data.Term }}</code></li>
+</ul>
+<h2>Path</h2>
+<p>
+  <ol>
+    {{ range .Ancestors.Reverse }}
+    <li>
+      <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
+    </li>
+    {{ end }}
+    <li class="active">
+      <a aria-current="page" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
+    </li>
+  </ol>
+</p>
+<h2>Menu</h2>
 {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
diff --git a/hugo/themes/thymeleaf/layouts/_partials/post_meta.html b/hugo/themes/thymeleaf/layouts/_partials/post_meta.html
new file mode 100644 (file)
index 0000000..ae996ba
--- /dev/null
@@ -0,0 +1,23 @@
+{{- $scratch := newScratch }}
+
+{{- if not .Date.IsZero -}}
+{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default ":date_long" site.Params.DateFormat)))) }}
+{{- end }}
+
+{{- if (.Param "ShowReadingTime") -}}
+{{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime)))) }}
+{{- end }}
+
+{{- if (.Param "ShowWordCount") -}}
+{{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "words" .WordCount | default (printf "%d words" .WordCount)))) }}
+{{- end }}
+
+{{- if not (.Param "hideAuthor") -}}
+{{- with (partial "author.html" .) }}
+{{- $scratch.Add "meta" (slice (printf "<span>%s</span>" .)) }}
+{{- end }}
+{{- end }}
+
+{{- with ($scratch.Get "meta") }}
+{{- delimit . "&nbsp;ยท&nbsp;" | safeHTML -}}
+{{- end -}}
diff --git a/hugo/themes/thymeleaf/layouts/archives.html b/hugo/themes/thymeleaf/layouts/archives.html
new file mode 100644 (file)
index 0000000..eea3fc8
--- /dev/null
@@ -0,0 +1,83 @@
+{{- define "main" }}
+
+<header class="page-header">
+  <h1>
+    {{ .Title }}
+    {{- if (.Param "ShowRssButtonInSectionTermList") }}
+    {{- $rss := (.OutputFormats.Get "rss") }}
+    {{- if (eq .Kind `page`) }}
+    {{- $rss = (.Parent.OutputFormats.Get "rss") }}
+    {{- end }}
+    {{- with $rss }}
+    <a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS">
+      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
+        stroke-linecap="round" stroke-linejoin="round" height="23">
+        <path d="M4 11a9 9 0 0 1 9 9" />
+        <path d="M4 4a16 16 0 0 1 16 16" />
+        <circle cx="5" cy="19" r="1" />
+      </svg>
+    </a>
+    {{- end }}
+    {{- end }}
+  </h1>
+  {{- if .Description }}
+  <div class="post-description">
+    {{ .Description }}
+  </div>
+  {{- end }}
+</header>
+
+{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+
+{{- if site.Params.ShowAllPagesInArchive }}
+{{- $pages = site.RegularPages }}
+{{- end }}
+
+{{- range $pages.GroupByPublishDate "2006" }}
+{{- if ne .Key "0001" }}
+<div class="archive-year">
+  {{- $year := replace .Key "0001" "" }}
+  <h2 class="archive-year-header" id="{{ $year }}">
+    <a class="archive-header-link" href="#{{ $year }}">
+      {{- $year -}}
+    </a>
+    <sup class="archive-count">&nbsp;{{ len .Pages }}</sup>
+  </h2>
+  {{- range .Pages.GroupByDate "January" }}
+  <div class="archive-month">
+    <h3 class="archive-month-header" id="{{ $year }}-{{ .Key }}">
+      <a class="archive-header-link" href="#{{ $year }}-{{ .Key }}">
+        {{- .Key -}}
+      </a>
+      <sup class="archive-count">&nbsp;{{ len .Pages }}</sup>
+    </h3>
+    <div class="archive-posts">
+      {{- range .Pages }}
+      {{- if eq .Kind "page" }}
+      <div class="archive-entry">
+        <h3 class="archive-entry-title entry-hint-parent">
+          {{- .Title | markdownify }}
+          {{- if .Draft }}
+          <span class="entry-hint" title="Draft">
+            <svg xmlns="http://www.w3.org/2000/svg" height="15" viewBox="0 -960 960 960" fill="currentColor">
+              <path
+                d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
+            </svg>
+          </span>
+          {{- end }}
+        </h3>
+        <div class="archive-meta">
+          {{- partial "post_meta.html" . -}}
+        </div>
+        <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
+      </div>
+      {{- end }}
+      {{- end }}
+    </div>
+  </div>
+  {{- end }}
+</div>
+{{- end }}
+{{- end }}
+
+{{- end }}{{/* end main */}}
index 39dcbec61fc7176b6b73a802b29dcc4508775836..5ed599025184d47705a61416cf2c9b1b575fc147 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="{{ site.Language.LanguageCode }}" dir="{{ or site.Language.LanguageDirection `ltr` }}">
+<html lang="{{ site.Language.LanguageCode }}" dir="{{ or site.Language.LanguageDirection `ltr` }}" th:replace="~{/templates/layout.html :: layout(uri='' + ~{:: code[class='site_uri']/text()}, title=~{:: title}, maincontent=~{:: .maincontent}, json='MERGE:' + ~{:: pre[class='json']/text()})}">
 <head>
   {{ partial "head.html" . }}
 </head>