commit f5ce674195bef6720c9e86e96b550e4cbfffa570
parent 3f028c079a39fb5b13ab6866781f90592ea4861f
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date: Wed, 8 Apr 2020 21:39:03 -0500
Implement a basic working framework
Diffstat:
7 files changed, 57 insertions(+), 9 deletions(-)
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
@@ -1,11 +1,9 @@
<!DOCTYPE html>
-<html>
- {{- partial "head.html" . -}}
- <body>
- {{- partial "header.html" . -}}
- <div id="content">
- {{- block "main" . }}{{- end }}
- </div>
- {{- partial "footer.html" . -}}
- </body>
+<html lang="{{ .Site.Language }}">
+ {{- partial "head.html" . -}}
+ <body>
+ {{- partial "header.html" . -}}
+ {{- block "main" . }}{{- end }}
+ {{- partial "footer.html" . -}}
+ </body>
</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -0,0 +1,15 @@
+{{ define "main" }}
+<main>
+ {{ .Content }}
+ {{ range (where .Site.RegularPages "Section" "!=" "") }}
+ <hr/>
+ <a href="{{ .Permalink }}">{{ .Date }}</a>
+ {{ if eq .Section "hoots" }}
+ {{ .Content }}
+ {{ else }}
+ <h1>{{ .Title }}</h1>
+ {{ .Content }}
+ {{ end }}
+ {{ end }}
+</main>
+{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -0,0 +1,8 @@
+{{ define "main" }}
+<header>
+ {{ if eq .Section "hoots" }}Hoot on {{ .Date }}{{ else }}<h1>{{ .Title }}</h1>{{ end }}</h1>
+</header>
+<main>
+ {{ .Content }}
+</main>
+{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
@@ -0,0 +1,5 @@
+<hr/>
+<footer>
+ © {{ .Site.Author.name }}
+ {{ .Site.Author.email }}
+</footer>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
@@ -0,0 +1,9 @@
+<head>
+ <style>
+ body {
+ margin: auto;
+ max-width: 60ch;
+ }
+ </style>
+ <title>{{ .Title }}</title>
+</head>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
@@ -0,0 +1,13 @@
+<nav>
+ {{ if .IsHome }}
+ {{- range $i, $menu := .Site.Menus.main -}}
+ {{- if (ge $i 1) }} | {{ end -}}
+ <a href="{{ .URL | relURL }}">{{ .Name }}</a>
+ {{- end -}}
+ {{- else -}}
+ <a href="{{ .Site.Home.Permalink | relURL }}">←{{ .Site.Title }}</a>
+ {{- end -}}
+ {{- range .Translations -}}
+ | <a href="{{ .Permalink | relURL }}">{{ .Language.LanguageName }}</a>
+ {{- end -}}
+</nav>