Läuft
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
{{ define "list" }} {{/* ‑‑ ausführbarer Entry‑Point */}}
|
||||
{{ template "base.html" . }} {{/* ruft das Layout auf */}}
|
||||
{{ end }}
|
||||
|
||||
{{ define "title" }}Alle Artikel{{ end }}
|
||||
|
||||
{{ define "body" }}
|
||||
<ul>
|
||||
<ul class="post-list" style="list-style:none; padding:0; display:grid; gap:var(--gap);">
|
||||
{{ range . }}
|
||||
<li>
|
||||
<a href="/post/{{ .Slug }}">{{ .Title }}</a>
|
||||
— {{ .Date.Format "02.01.2006" }}
|
||||
<a class="card" href="/post/{{ .Slug }}">
|
||||
{{ if .Cover }}
|
||||
<img src="{{ .Cover }}" alt="">
|
||||
{{ else }}
|
||||
<img src="/static/img/placeholder.png" alt="">
|
||||
{{ end }}
|
||||
<div>
|
||||
<h2>{{ .Title }}</h2>
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{ define "list" }}{{ template "layout" . }}{{ end }}
|
||||
|
Reference in New Issue
Block a user