hugo-ataru

Hugo theme with titleless posts and microformats2 support

git clone git://git.shimmy1996.com/hugo-ataru.git
commit b36d232c077eb2bf80d65eaf69608370bcec5e81
parent 1d770b91c48a40e69de7f826657d22f36dffe110
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Tue, 26 Jul 2022 19:35:44 -0500

Switch to use flex box

Diffstat:
Mlayouts/_default/single.html | 17+++++++++++------
Mlayouts/partials/footer.html | 10++++++++--
Mlayouts/partials/head.html | 16++++++++++++----
Mlayouts/partials/language.html | 2+-
Mlayouts/partials/nav_page.html | 8+++-----
5 files changed, 35 insertions(+), 18 deletions(-)
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -1,14 +1,19 @@
 {{ define "main" }}
 <main class="h-entry">
   <header>
-    {{ $timestamp := .Date.Format "2006-01-02T15:04:05Z07:00" }}
-    <a class="u-url" href="{{ .RelPermalink }}">
-      <time class="dt-published" datetime="{{ $timestamp }}">{{- $timestamp -}}
-    </time></a>{{ partial "language.html" . }}
-    <span style="float:right;"><a href="{{ "/" | relLangURL }}" class="u-author">⏎</a></span>
+    <nav>
+      <span class="menu">
+        {{ $timestamp := .Date.Format "2006-01-02T15:04:05Z07:00" }}
+        <a class="entry u-url" href="{{ .RelPermalink }}">
+          <time class="dt-published" datetime="{{ $timestamp }}">{{- $timestamp -}}
+        </time></a>
+        {{ partial "language.html" . }}
+      </span>
+      <a class="menu-right u-author" href="{{ "/" | relLangURL }}">⏎</a>
+    </nav>
     {{ with .Title }}<h1 class="p-name">{{ . }}</h1>{{ end }}
   </header>
-  <div class="e-content">{{ .Content }}</div>
+  <article class="e-content">{{ .Content }}</article>
   {{ partial "hyperskip.html" . }}
 </main>
 {{ end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
@@ -1,4 +1,10 @@
 <footer>
-  <nav>{{ partial "nav_page.html" . }}</nav>
-  {{ with .Site.Copyright }}{{ . | markdownify }}{{ end }}
+  <nav>
+    <span class="menu entry">
+      {{ with .Site.Copyright }}{{ . | markdownify }}{{ end }}
+    </span>
+    <span class="menu-right">
+      {{ partial "nav_page.html" . }}
+    </span>
+  </nav>
 </footer>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
@@ -19,10 +19,18 @@
     pre {
         overflow-x: auto;
     }
-    .h-feed .h-entry {
-        margin-top: 0.5em;
-        padding-top: 0.5em;
-        border-top: 1px dotted;
+    nav, nav .menu {
+        display: flex;
+    }
+    .menu {
+        flex: 1 1;
+        flex-flow:row wrap;
+    }
+    .entry {
+        margin-right: 0.75ch;
+    }
+    .menu-right {
+        flex: 0 0 content;
     }
     {{ partial "css/custom.css" . | safeCSS }}
   </style>
diff --git a/layouts/partials/language.html b/layouts/partials/language.html
@@ -1,3 +1,3 @@
 {{- range (sort .Translations ".Language.LanguageName") -}}
-&nbsp;|&nbsp;<a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a>
+<a class="entry" href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a>
 {{- end -}}
diff --git a/layouts/partials/nav_page.html b/layouts/partials/nav_page.html
@@ -1,8 +1,6 @@
 {{ if .IsNode }}
 {{ $pag := partial "get_paginator.html" . }}
-<span style="float:right">
-  {{ 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>
+{{ 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 }}
 {{ end }}