From f0506acd6f70da636b8fdb23439c85bbf2392b40 Mon Sep 17 00:00:00 2001 From: Arne Rief Date: Sat, 16 Aug 2025 22:42:03 +0200 Subject: HTML templates done --- layouts/404.html | 9 ++++ layouts/_default/baseof.html | 18 +++---- layouts/_default/list.html | 33 +++++++++++++ layouts/_default/single.html | 19 ++++++++ layouts/index.html | 22 +++++++++ layouts/partials/footer.html | 4 +- layouts/partials/head/meta.html | 21 +++++--- layouts/partials/head/seo.html | 86 ++++++++++++++++----------------- layouts/partials/header.html | 6 +-- layouts/partials/list/pagination.html | 28 +++++++++++ layouts/partials/list/post-card.html | 45 +++++++++++++++++ layouts/partials/list/recent-posts.html | 50 +++++++++++++++++++ layouts/partials/navmenu.html | 58 +++++++++++----------- layouts/partials/single/next-prev.html | 30 ++++++++++++ layouts/partials/single/tags.html | 17 +++++++ layouts/tags/list.html | 37 ++++++++++++++ layouts/tags/term.html | 42 ++++++++++++++++ 17 files changed, 431 insertions(+), 94 deletions(-) create mode 100644 layouts/404.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/list/pagination.html create mode 100644 layouts/partials/list/post-card.html create mode 100644 layouts/partials/list/recent-posts.html create mode 100644 layouts/partials/single/next-prev.html create mode 100644 layouts/partials/single/tags.html create mode 100644 layouts/tags/list.html create mode 100644 layouts/tags/term.html (limited to 'layouts') diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..9859cd3 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,9 @@ +{{- define "main" }} +

{{ lang.Translate "404.title" | default "Page not found" }}

+

{{ lang.Translate "404.description" | default "The requested page does not exist" }}

+

+ + {{ lang.Translate "404.homepage" | default "Back to the homepage" }} + +

+{{- end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 3ca9201..3c4865b 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,5 +1,5 @@ - + @@ -9,7 +9,7 @@ {{- else }} {{- if or .IsPage .IsSection}} - + {{- else }} {{- end }} @@ -19,20 +19,20 @@ {{- if .IsTranslated }} - {{ range .Translations }} + {{- range .Translations }} - {{ end }} + {{- end }} {{- end }} - {{ partial "head/meta.html" . }} - {{ partial "head/seo.html" . }} - {{ partialCached "head/css.html" . }} + {{- partial "head/meta.html" . }} + {{- partial "head/seo.html" . }} + {{- partialCached "head/css.html" . }} - + {{ partial "header.html" . }} -
+
{{ block "main" . }}{{ end }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index e69de29..8ff9b18 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -0,0 +1,33 @@ +{{- define "main" }} +
+
+

+ {{ .Title }} +

+ {{- $description := or .Description .Summary (lang.Translate "list.default_description" .Title | default (printf "All posts in %s" .Title)) }} +

+ {{ $description }} +

+
+ +
+ {{- /* 20 posts per site */ -}} + {{- $paginator := .Paginate .Pages 20 }} + {{- with $paginator.Pages }} +
    + {{- range . }} +
  • + {{- partial "list/post-card.html" . }} +
  • + {{- end }} +
+ {{- else }} +

+ {{ lang.Translate "list.empty" | default "No posts found in this section." }} +

+ {{- end }} +
+ + {{- partial "list/pagination.html" $paginator }} +
+{{- end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e69de29..24bc5c9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -0,0 +1,19 @@ +{{- define "main" }} +
+
+

{{ .Title }}

+ +
+ +
+ {{ .Content }} +
+ +
+ {{ partial "single/tags" . }} + {{ partial "single/next-prev" . }} +
+
+{{- end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..127af83 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,22 @@ +{{- /* HOMEPAGE */ -}} +{{- define "main" }} +
+
+

+ {{ with .Title }}{{ . }}{{ else }}{{ site.Title | default "Welcome to my Blog!" }}{{ end }} +

+ {{- with .Content }} +
+ {{ . }} +
+ {{- end }} +
+ + {{- partial "list/recent-posts.html" (dict + "count" 10 + "title" (lang.Translate "posts.recent" | default "Recent Articles") + "show_view_all" true + ) + -}} +
+{{- end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a74a6a4..a934e59 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,3 +1,3 @@ -