Refactor code structure for improved readability and maintainability

This commit is contained in:
Fundor333
2025-12-22 15:57:37 +01:00
parent 038dc61b92
commit 4a8054dc19
7 changed files with 44 additions and 34 deletions

View File

@@ -9,3 +9,4 @@
@import "link"; @import "link";
@import "weeknote"; @import "weeknote";
@import "share-button"; @import "share-button";
@import "typewriter";

View File

@@ -0,0 +1,8 @@
@font-face {
font-family: "Typewriter";
src: url("/fonts/American Typewriter Regular.ttf");
}
.typewriter {
font-family: "Typewriter", monospace;
}

View File

@@ -1,26 +1,27 @@
{{- define "main" -}} {{- define "main" -}}
<div class="wrapper list-page"> <div class="wrapper list-page">
<header class="header"> <header class="header">
<h1 class="header-title center">{{ .Title }}</h1> <h1 class="header-title center typewriter">{{ .Title }}</h1>
</header> </header>
<main class="page-content e-content" aria-label="Content"> <main class="page-content e-content typewriter" aria-label="Content">
{{.Content}} {{.Content}}
{{/* create a list of posts for each month, with month as heading */}} {{/* create a list of posts for each month, with month as heading */}}
{{ range $index, $element := .Pages.ByDate.Reverse }} {{ range $index, $element := .Pages.ByDate.Reverse }}
{{ if (eq $index 0) }}
{{ $element.Content}}
<hr class="p-4">
{{ if (eq $index 0) }} {{else}}
{{ $element.Content}} {{ partial "postCard" $element }}
{{else}} {{ end }}
{{ partial "postCard" $element }}
{{ end }}
{{ end }} {{/* end range .Pages.ByDate */}} {{ end }} {{/* end range .Pages.ByDate */}}
</main> </main>
{{- partial "syndication.html" . -}} {{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}} {{- partial "comments.html" . -}}
</div> </div>
{{- end -}} {{- end -}}

View File

@@ -1,21 +1,21 @@
{{ define "main" }} {{ define "main" }}
<div class="wrapper post"> <div class="wrapper post">
<main class="page-content" aria-label="Content"> <main class="page-content" aria-label="Content">
<article class="h-entry post-entry"> <article class="h-entry post-entry ">
<header class="header"> <header class="header">
<h1 class="header-title p-name">{{ .Title }} <a href="/now/"><i class="fa-whiteboard fa-semibold fa-backward-step"></i></a></h1> <h1 class="header-title p-name typewriter">{{ .Title }} <a href="/now/"><i class="fa-whiteboard fa-semibold fa-backward-step"></i></a></h1>
<div> <div>
<a class="u-url" href="{{ .Permalink }}"><div style="display: none;" class="p-summary">{{ .Description }}</div></a> <a class="u-url" href="{{ .Permalink }}"><div style="display: none;" class="p-summary">{{ .Description }}</div></a>
<a rel="author" class="p-author h-card no-underline " href="{{ .Site.BaseURL }}" style="display: none;" >{{ .Site.Params.Author.name }}</a> <a rel="author" class="p-author h-card no-underline " href="{{ .Site.BaseURL }}" style="display: none;">{{ .Site.Params.Author.name }}</a>
</div> </div>
</header> </header>
<div class="page-content e-content"> <div class="page-content e-content typewriter">
{{ .Content }} {{ .Content }}
</div> </div>
{{- partial "syndication.html" . -}} {{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}} {{- partial "comments.html" . -}}
</article> </article>
</main> </main>
</div> </div>
{{ end }} {{ end }}

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"Target":"add.min.1c9d7693af8759a9b5a45018bdb62663e078677565f40e191c5479ecba6f3520.css","MediaType":"text/css","Data":{"Integrity":"sha256-HJ12k6+HWam1pFAYvbYmY+B4Z3Vl9A4ZHFR57LpvNSA="}} {"Target":"add.min.d68b45f55db8f7f9afebda427f0f2a128985ec043a7d7d4163a6ad726238475a.css","MediaType":"text/css","Data":{"Integrity":"sha256-1otF9V249/mv69pCfw8qEomF7AQ6fX1BY6atcmI4R1o="}}

Binary file not shown.