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

@@ -1,26 +1,27 @@
{{- define "main" -}}
<div class="wrapper list-page">
<header class="header">
<h1 class="header-title center">{{ .Title }}</h1>
</header>
<main class="page-content e-content" aria-label="Content">
<header class="header">
<h1 class="header-title center typewriter">{{ .Title }}</h1>
</header>
<main class="page-content e-content typewriter" aria-label="Content">
{{.Content}}
{{/* create a list of posts for each month, with month as heading */}}
{{.Content}}
{{/* 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) }}
{{ $element.Content}}
{{else}}
{{ partial "postCard" $element }}
{{ end }}
{{else}}
{{ partial "postCard" $element }}
{{ end }}
{{ end }} {{/* end range .Pages.ByDate */}}
</main>
{{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}}
{{ end }} {{/* end range .Pages.ByDate */}}
</main>
{{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}}
</div>
{{- end -}}

View File

@@ -1,21 +1,21 @@
{{ define "main" }}
<div class="wrapper post">
<main class="page-content" aria-label="Content">
<article class="h-entry post-entry">
<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>
<main class="page-content" aria-label="Content">
<article class="h-entry post-entry ">
<header class="header">
<h1 class="header-title p-name typewriter">{{ .Title }} <a href="/now/"><i class="fa-whiteboard fa-semibold fa-backward-step"></i></a></h1>
<div>
<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>
</div>
</header>
<div class="page-content e-content">
{{ .Content }}
</div>
{{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}}
</article>
</main>
<div>
<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>
</div>
</header>
<div class="page-content e-content typewriter">
{{ .Content }}
</div>
{{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}}
</article>
</main>
</div>
{{ end }}