This commit is contained in:
2025-05-04 13:40:31 +02:00
parent afd8edaa6c
commit 92d272b36e
10 changed files with 293 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
{{ define "article" }}
{{ template "base.html" . }}
{{ end }}
{{ define "title" }}{{ .Title }}  B1tsblog{{ end }}
{{ define "body" }}
<article class="article">
<header>
<h1>{{ .Title }}</h1>
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>
</header>
<div class="article-content">
{{ .Body }}
</div>
<p><a href="/"> Alle Artikel</a></p>
</article>
{{ end }}

View File

@@ -0,0 +1,15 @@
<!DOCTYPE html><html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{{ block "title" . }}B1tsblog{{ end }}</title>
<link rel="stylesheet" href="/static/main.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<!-- MonospaceFont für Code (optional) -->
<link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap" rel="stylesheet">
</head>
<body>
<header><h1><a href="/">B1tsblog</a></h1></header>
<main>{{ block "body" . }}{{ end }}</main>
<footer>© {{ now.Year }}</footer>
</body></html>

View File

@@ -0,0 +1,16 @@
{{ define "list" }} {{/* ausführbarer EntryPoint */}}
{{ template "base.html" . }} {{/* ruft das Layout auf */}}
{{ end }}
{{ define "title" }}Alle Artikel{{ end }}
{{ define "body" }}
<ul>
{{ range . }}
<li>
<a href="/post/{{ .Slug }}">{{ .Title }}</a>
— {{ .Date.Format "02.01.2006" }}
</li>
{{ end }}
</ul>
{{ end }}