hugo-ataru

Hugo theme with titleless posts and microformats2 support

git clone git://git.shimmy1996.com/hugo-ataru.git
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:
Mlayouts/_default/baseof.html | 16+++++++---------
Mlayouts/_default/list.html | 15+++++++++++++++
Mlayouts/_default/single.html | 8++++++++
Dlayouts/index.html | 0
Mlayouts/partials/footer.html | 5+++++
Mlayouts/partials/head.html | 9+++++++++
Mlayouts/partials/header.html | 13+++++++++++++
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>
+  &copy; {{ .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) }}&nbsp;|&nbsp;{{ end -}}
+  <a href="{{ .URL | relURL }}">{{ .Name }}</a>
+  {{- end -}}
+  {{- else -}}
+  <a href="{{ .Site.Home.Permalink | relURL }}">←{{ .Site.Title }}</a>
+  {{- end -}}
+  {{- range .Translations -}}
+  &nbsp;|&nbsp;<a href="{{ .Permalink | relURL }}">{{ .Language.LanguageName }}</a>
+  {{- end -}}
+</nav>