hugo-ataru

Hugo theme with titleless posts and microformats2 support

git clone git://git.shimmy1996.com/hugo-ataru.git
commit 7fed5355ba2e87e35864da8107d9f66b27516834
parent c043a4dcb049d8d1cb28aea5b3685dd1a42a1ca6
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sun, 19 Apr 2020 22:58:50 -0500

Move translation list into its own partial

Diffstat:
Mlayouts/_default/list.html | 4+---
Mlayouts/_default/single.html | 5+----
Alayouts/partials/language.html | 3+++
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -4,9 +4,7 @@
   {{- 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 "language.html" . }}
   {{ partial "nav_page.html" . }}
 </nav>
 <main class="h-feed">
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -4,11 +4,8 @@
     {{ $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>{{ partial "language.html" . }}
     <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>
diff --git a/layouts/partials/language.html b/layouts/partials/language.html
@@ -0,0 +1,3 @@
+{{- range .Translations -}}
+&nbsp;|&nbsp;<a href="{{ .Permalink | relURL }}">{{ .Language.LanguageName }}</a>
+{{- end -}}