hugo-djem-so

Hugo theme for my blog

git clone git://git.shimmy1996.com/hugo-djem-so.git
commit f711c65e5c37d0dee9ed4195693cdfe9605c4d28
parent c10ef38b9dbcc8c15a5161d49eb242a97718de54
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sun,  5 Jan 2020 17:26:41 -0600

Move common contents to baseof.html

Diffstat:
Mlayouts/_default/baseof.html | 10++++++++--
Mlayouts/_default/list.html | 7+++----
Mlayouts/_default/single.html | 7+------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
@@ -2,9 +2,15 @@
 <html lang="{{ .Site.Language }}">
   {{ partial "head.html" . }}
   <body>
-    {{ partial "nav.html" . }}
     <main>
-      {{ block "main" . }}{{ end }}
+      <article>
+        <header>
+          <h1>{{ .Title }}</h1>
+          {{ partial "nav.html" . }}
+        </header>
+        {{ .Content }}
+        {{ block "extras" . }}{{ end }}
+      </article>
     </main>
     {{ partial "footer.html" . }}
   </body>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -1,6 +1,5 @@
-{{ define "main" }}
-<article>
-  {{ .Content }}
+{{ define "extras" }}
+<nav>
   <ul>
     {{ $pages := .Data.Pages }}
     {{ if .IsHome }}
@@ -10,5 +9,5 @@
     <li><time>{{ .Date.Format "2006-01-02" }}</time>&nbsp;<a href="{{ .Permalink }}">{{ .Title }}</a></li>
     {{ end }}
   </ul>
-</article>
+</nav>
 {{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -1,6 +1 @@
-{{ define "main" }}
-<article>
-  <h1>{{ .Title }}</h1>
-  {{ .Content }}
-</article>
-{{ end }}
+{{ define "extras" }}{{ end }}