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) fmt.Println(err)
} }
/* */
for a, b := range articles {
articles[a].Counter = getTick(b.Slug)
}
/* */
staticPages, err := article.LoadStatic(pagesDir) staticPages, err := article.LoadStatic(pagesDir)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
@@ -122,6 +114,15 @@ func main() {
http.NotFound(w, r) http.NotFound(w, r)
return return
} }
/* */
for a, b := range articles {
articles[a].Counter = getTick(b.Slug)
}
/* */
if err := tplList.ExecuteTemplate(w, "layout", article.ListPage{ if err := tplList.ExecuteTemplate(w, "layout", article.ListPage{
Title: "Startseite", Title: "Startseite",
Description: "Alle Artikel im Überblick", 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 h2 { margin: .25rem 0 .5rem; font-size: 1.25rem; line-height: 1.3; }
.card time { color: var(--text-muted); font-size: .85rem; } .card time { color: var(--text-muted); font-size: .85rem; }
.card-count { 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 ---------- */ /* ---------- Artikel ---------- */
.hero { .hero {

View File

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