hugo-ataru

Hugo theme with titleless posts and microformats2 support

git clone git://git.shimmy1996.com/hugo-ataru.git
commit bd80c41f23169190f05e2d6776c6f421b8f19b11
parent e7e9d0f3477389ad24866e7ed0ae69d01c5a06b6
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Mon, 13 Apr 2020 10:48:57 -0500

Change navigation

Diffstat:
Mlayouts/_default/baseof.html | 1-
Mlayouts/_default/list.html | 10++++++++++
Mlayouts/_default/single.html | 15++++++++++++---
Dlayouts/partials/nav.html | 14--------------
Mlayouts/partials/nav_page.html | 11++---------
5 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
@@ -2,7 +2,6 @@
 <html lang="{{ .Site.Language }}">
   {{- partial "head.html" . -}}
   <body>
-    {{- partial "nav.html" . -}}
     {{- block "main" . }}{{- end }}
     {{- partial "footer.html" . -}}
   </body>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -1,4 +1,14 @@
 {{ define "main" }}
+<nav>
+  {{- range $i, $menu := .Site.Menus.main -}}
+  {{- if (ge $i 1) }}&nbsp;|&nbsp;{{ end -}}
+  <a href="{{ .URL | relURL }}">{{ .Name }}</a>
+  {{- end -}}
+  {{- range .Translations -}}
+  &nbsp;|&nbsp;<a href="{{ .Permalink | relURL }}">{{ .Language.LanguageName }}</a>
+  {{- end -}}
+  {{ partial "nav_page.html" . }}
+</nav>
 <main class="h-feed">
   {{ $pag := partial "get_paginator.html" . }}
   {{ if (not $pag.HasPrev) }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -1,8 +1,17 @@
 {{ define "main" }}
 <main class="h-entry">
-  {{ partial "header.html" . }}
-  {{ if .Title }}<div class="e-content">{{ else }}<div class="e-content p-name">{{ end }}
-  {{ .Content }}</div>
+  <header>
+    {{ $timestamp := .Date.Format "2006-01-02T15:04:05Z07:00" }}
+    <a class="u-url" href="{{ .Permalink }}">
+      <time class="dt-published" datetime="{{ $timestamp }}">{{ $timestamp }}</time>
+    </a>
+    <span style="float:right;"><a href="{{ "/" | relLangURL }}" class="u-author">⏎</a></span>
+    {{- range .Translations -}}
+    &nbsp;|&nbsp;<a href="{{ .Permalink | relURL }}">{{ .Language.LanguageName }}</a>
+    {{- end -}}
+    {{ with .Title }}<h1 class="p-name">{{ . }}</h1>{{ end }}
+  </header>
+  <div class="e-content">{{ .Content }}</div>
   {{ partial "hyperskip.html" . }}
 </main>
 {{ end }}
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
@@ -1,14 +0,0 @@
-<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 -}}
-  {{ partial "nav_page.html" . }}
-</nav>
diff --git a/layouts/partials/nav_page.html b/layouts/partials/nav_page.html
@@ -1,15 +1,8 @@
 {{ if .IsNode }}
 {{ $pag := partial "get_paginator.html" . }}
 <span style="float:right">
-  {{ if $pag.HasNext }}<a href="{{ $pag.Next.URL }}">↑</a>{{ else }}↑{{ end }}
+  {{ if $pag.HasNext }}<a href="{{ $pag.Next.URL }}">←</a>{{ else }}←{{ end }}
   {{ add 1 (sub $pag.TotalPages $pag.PageNumber) }}/{{ $pag.TotalPages }}
-  {{ if $pag.HasPrev }}<a href="{{ $pag.Prev.URL }}">↓</a>{{ else }}↓{{ end }}
-</span>
-{{ else }}
-<span style="float:right">
-  {{with .PrevInSection }}<a href="{{ .RelPermalink }}">↑</a>{{ else }}↑{{end}}
-  {{ $pages := where .Site.RegularPages "Section" "==" .Section }}
-  {{ len (where $pages ".Date" "le" $.Date) }}/{{ len $pages }}
-  {{with .NextInSection }}<a href="{{ .RelPermalink }}">↓</a>{{ else }}↓{{end}}
+  {{ if $pag.HasPrev }}<a href="{{ $pag.Prev.URL }}">→</a>{{ else }}→{{ end }}
 </span>
 {{ end }}