hugo-ataru

Hugo theme with titleless posts and microformats2 support

git clone git://git.shimmy1996.com/hugo-ataru.git
commit 140c33f604ea1b4af46480fd561d28ae8e6ffcc5
parent 10793079f4ae46296e2ac1b6f40e5dae5d95b008
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Fri, 10 Apr 2020 22:27:42 -0500

Move navigation to nav.html

Diffstat:
Mlayouts/_default/baseof.html | 2+-
Mlayouts/_default/list.html | 7+------
Mlayouts/_default/single.html | 7+------
Mlayouts/partials/header.html | 24++++++++++--------------
Clayouts/partials/header.html -> layouts/partials/nav.html | 0
5 files changed, 13 insertions(+), 27 deletions(-)
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
@@ -2,7 +2,7 @@
 <html lang="{{ .Site.Language }}">
   {{- partial "head.html" . -}}
   <body>
-    {{- partial "header.html" . -}}
+    {{- partial "nav.html" . -}}
     {{- block "main" . }}{{- end }}
     {{- partial "footer.html" . -}}
   </body>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -11,12 +11,7 @@
   {{ end }}
   {{ range $pag.Pages }}
   <article class="h-entry">
-    <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>
-      - <a class="p-author h-card" href="{{ .Site.Author.url }}">{{ .Site.Author.name }}</a>
-      {{ with .Title }}<h2 class="p-name">{{ . }}</h2>{{ end }}
-    </header>
+    {{ partial "header.html" . }}
     {{ if eq .Section "posts" }}
     <div class="p-summary">{{ range (findRE "<p>.*</p>" .Content 1) }}{{ (replaceRE "<.p>" "" .) | safeHTML}}{{ end }}</div>
     {{ else }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -1,12 +1,7 @@
 {{ define "main" }}
 <hr/>
 <main class="h-entry">
-  <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>
-    - <a class="p-author h-card" href="{{ .Site.Author.url }}">{{ .Site.Author.name }}</a>
-    {{ with .Title }}<h1 class="p-name">{{ . }}</h1>{{ end }}
-  </header>
+  {{ partial "header.html" . }}
   <div class="e-content">{{ .Content }}</div>
   {{ partial "hyperskip.html" . }}
 </main>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
@@ -1,14 +1,10 @@
-<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>
+<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>
+  - <a class="p-author h-card" href="{{ .Site.Author.url }}">{{ .Site.Author.name }}</a>
+  {{ with .Title }}{{ if $.IsNode }}
+  <h2 class="p-name">{{ . }}</h2>
+  {{ else }}
+  <h1 class="p-name">{{ . }}</h1>
+  {{ end }}{{ end }}
+</header>
diff --git a/layouts/partials/header.html b/layouts/partials/nav.html