Card-Fix für Counter und Berechnungs-Fix
All checks were successful
release-tag / release-image (push) Successful in 2m8s

This commit is contained in:
2025-05-11 11:07:25 +02:00
parent 08ef9c7132
commit 2e31bfdc77
3 changed files with 14 additions and 10 deletions

View File

@@ -101,14 +101,6 @@ func main() {
fmt.Println(err)
}
/* */
for a, b := range articles {
articles[a].Counter = getTick(b.Slug)
}
/* */
staticPages, err := article.LoadStatic(pagesDir)
if err != nil {
fmt.Println(err)
@@ -122,6 +114,15 @@ func main() {
http.NotFound(w, r)
return
}
/* */
for a, b := range articles {
articles[a].Counter = getTick(b.Slug)
}
/* */
if err := tplList.ExecuteTemplate(w, "layout", article.ListPage{
Title: "Startseite",
Description: "Alle Artikel im Überblick",

View File

@@ -128,6 +128,7 @@ footer {
.card h2 { margin: .25rem 0 .5rem; font-size: 1.25rem; line-height: 1.3; }
.card time { color: var(--text-muted); font-size: .85rem; }
.card-count { color: var(--text-muted); font-size: .85rem; }
.card-meta { display: flex; gap: 1rem; /* optionaler Abstand zwischen den Elementen */}
/* ---------- Artikel ---------- */
.hero {

View File

@@ -10,8 +10,10 @@
{{ end }}
<div class="card-content">
<h2>{{ .Title }}</h2>
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>
<p class="card-count">{{ .Counter }}</p>
<div class="card-meta">
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>
<p class="card-count">{{ .Counter }}</p>
</div>
</div>
</a>
</li>