feature: Set up templated views and blog support

This commit is contained in:
Keith Solomon
2025-04-20 15:39:22 -05:00
parent 463250eb7b
commit 3fe75e9ad5
20 changed files with 580 additions and 255 deletions

28
templates/base.html Normal file
View File

@@ -0,0 +1,28 @@
{{ define "base" }}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{ .Title }}</title>
</head>
<body>
{{ template "header" . }}
<main>
{{- if eq .PageTemplate "blog_index" -}}
{{ template "blog_index_content" . }}
{{- else if eq .PageTemplate "static" -}}
{{ template "static_content" . }}
{{- else if eq .PageTemplate "blog_post" -}}
{{ template "blog_post_content" . }}
{{- else if eq .PageTemplate "category_page" -}}
{{ template "category_content" . }}
{{- else -}}
<p>Unknown PageTemplate: {{ .PageTemplate }}</p>
{{- end -}}
</main>
{{ template "footer" . }}
</body>
</html>
{{ end }}