hugo-ataru

Hugo theme with titleless posts and microformats2 support

git clone git://git.shimmy1996.com/hugo-ataru.git
commit 8781f98150c9cbd65f8478a7e9d984f77f850eac
parent f5ce674195bef6720c9e86e96b550e4cbfffa570
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Wed,  8 Apr 2020 21:59:11 -0500

Add the microformats markup

Diffstat:
Mlayouts/_default/list.html | 21+++++++++++++--------
Mlayouts/_default/single.html | 11+++++++----
Mlayouts/partials/footer.html | 8+++++---
3 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -1,15 +1,20 @@
 {{ 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 }}
+  {{ $pages := .Data.Pages }}
+  {{ if .IsHome }}
+  {{ $pages = (first 15 (where .Site.RegularPages "Section" "!=" "")) }}
   {{ end }}
+  {{ range $pages }}
+  <hr/>
+  <article class="h-entry">
+    <header>
+      <a class="u-url" href="{{ .Permalink }}"><time class="dt-published" datetime="{{ .Date }}">{{ .Date }}</time></a>
+      - <a class="p-author h-card" href="{{ .Site.Author.url }}">{{ .Site.Author.name }}</a>
+      {{ with .Title }}<h1 class="p-name">{{ . }}</h1>{{ end }}
+    </header>
+    <div class="e-content">{{ .Content }}</div>
+  </article>
   {{ end }}
 </main>
 {{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -1,8 +1,11 @@
 {{ define "main" }}
-<header>
-  {{ if eq .Section "hoots" }}Hoot on {{ .Date }}{{ else }}<h1>{{ .Title }}</h1>{{ end }}</h1>
-</header>
-<main>
+<hr/>
+<main class="h-entry">
+  <header>
+    <a class="u-url" href="{{ .Permalink }}"><time class="dt-published" datetime="{{ .Date }}">{{ .Date }}</time></a>
+    - <a class="p-author h-card" href="{{ .Site.Author.url }}">{{ .Site.Author.name }}</a>
+    {{ with .Title }}<h1 class="p-name">{{ . }}</h1>{{ end }}
+  </header>
   {{ .Content }}
 </main>
 {{ end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
@@ -1,5 +1,7 @@
 <hr/>
-<footer>
-  &copy; {{ .Site.Author.name }}
-  {{ .Site.Author.email }}
+{{ if .IsHome }}
+<footer class="h-card">
+  &copy; <a rel="me" class="p-name u-url" href="{{ .Site.Author.url }}">{{ .Site.Author.name }}</a><br/>
+  <a rel="me" class="u-email" href="mailto:{{ .Site.Author.email }}">{{ .Site.Author.email }}</a>
 </footer>
+{{ end }}