✨feature: Set up templated views and blog support
This commit is contained in:
28
templates/base.html
Normal file
28
templates/base.html
Normal 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 }}
|
||||
Reference in New Issue
Block a user