blog

My blog at www.shimmy1996.com

git clone git://git.shimmy1996.com/blog.git
commit f9f1abb85569cdc3526a0e1d8f040351de819dd9
parent 999034610ba94366be8e2e836d64f75ec9b2a666
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Tue, 26 Jul 2022 23:12:46 -0500

Use new style nav bar

Diffstat:
Mlayouts/_default/list.html | 19++++++++++++-------
Mlayouts/partials/css/custom.css | 2+-
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -1,11 +1,16 @@
 {{ define "main" }}
-<nav>{{ partial "nav_page.html" . }}</nav>
 <nav>
-  {{- range $i, $menu := .Site.Menus.main -}}
-  {{- if (ge $i 1) }}&nbsp;|&nbsp;{{ end -}}
-  <a href="{{ .URL | relURL }}">{{ .Name }}</a>
-  {{- end -}}
-  {{ partial "language.html" . }}
+  <span class="menu">
+    {{- range $i, $menu := .Site.Menus.main }}
+    <a class="entry" href="{{ .URL | relURL }}">{{ .Name }}</a>
+    {{ end }}
+    {{ range (sort .Translations ".Language.LanguageName") }}
+    <a class="entry" href="{{ .RelPermalink }}">{{- .Language.LanguageName }}</a>
+    {{ end -}}
+  </span>
+  <span class="menu-right">
+    {{ partial "nav_page.html" . }}
+  </span>
 </nav>
 <main class="h-feed">
   {{ $pag := partial "get_paginator.html" . }}
@@ -20,7 +25,7 @@
   </ul></nav>
   {{ end }}
   {{ range $pag.Pages.ByDate }}
-  <div class="h-entry" id="{{ .Date.Format "2006-01-02T15-04-05Z07-00"}}">
+  <div class="h-entry top-border" id="{{ .Date.Format "2006-01-02T15-04-05Z07-00"}}">
     {{ partial "header.html" . }}
     <div class="e-content">{{ .Content }}</div>
   </div>
diff --git a/layouts/partials/css/custom.css b/layouts/partials/css/custom.css
@@ -7,7 +7,7 @@ textarea {
     width: 100%;
     box-sizing: border-box;
 }
-article {
+.top-border {
     margin-top: 0.5em;
     padding-top: 0.5em;
     border-top: 1px dotted;