hugo-djem-so

Hugo theme for my blog

git clone git://git.shimmy1996.com/hugo-djem-so.git
commit 7b2f1d6744fdefd69fb49963efb808ab36b459dd
parent 71a25bdc708963fc591d12109d19faf9de542149
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sat, 30 Nov 2019 00:15:41 -0500

Always display link to homepage

Diffstat:
MREADME.org | 11+++++------
Mlayouts/_default/baseof.html | 3+--
Mlayouts/_default/list.html | 2+-
Mlayouts/_default/single.html | 5++++-
Dlayouts/partials/header.html | 5-----
Mlayouts/partials/nav.html | 4+---
6 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/README.org b/README.org
@@ -6,22 +6,21 @@ Djem So is a aggressively stripped down version of my [[https://github.com/shimm
 - remove extra style tweaks on syntax highlighting;
 - reduce number of colors used.
 
-What is retained though is support for multilingual page contents. The result is an bare-bone theme that still allows easy customization. In fact, Djem So has exactly 100 lines, even less than the XMin theme that started it all.
+What is retained though is support for multilingual page contents. The result is an bare-bone theme that still allows easy customization. In fact, Djem So has even less lines than the XMin theme that started it all.
 
 #+BEGIN_EXAMPLE
   $ find . -path '*/layouts/*' \( -name '*.html' -o -name '*.css' \) | xargs wc -l
-     5 ./layouts/partials/header.html
      6 ./layouts/partials/css/color.css
      0 ./layouts/partials/css/custom.css
     31 ./layouts/partials/css/style.css
      1 ./layouts/partials/footer.html
      0 ./layouts/partials/head_custom.html
-    19 ./layouts/partials/nav.html
+    17 ./layouts/partials/nav.html
     11 ./layouts/partials/head.html
-     1 ./layouts/_default/single.html
+     4 ./layouts/_default/single.html
     14 ./layouts/_default/list.html
-    12 ./layouts/_default/baseof.html
-   100 total
+    11 ./layouts/_default/baseof.html
+    95 total
 #+END_EXAMPLE
 
 ** Customization
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
@@ -4,8 +4,7 @@
   <body>
     {{ partial "nav.html" . }}
     <main>
-      {{ partial "header.html" . }}
-      {{ block "content" . }}{{ end }}
+      {{ block "main" . }}{{ end }}
     </main>
     {{ partial "footer.html" . }}
   </body>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -1,4 +1,4 @@
-{{ define "content" }}
+{{ define "main" }}
 <article>
   {{ .Content }}
   <ul>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -1 +1,4 @@
-{{ define "content" }}<article>{{ .Content }}</article>{{ end }}
+{{ define "main" }}
+<header><h1>{{ .Title }}</h1></header>
+<article>{{ .Content }}</article>
+{{ end }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
@@ -1,5 +0,0 @@
-{{ if .IsPage }}
-<header><h1>{{ .Title }}</h1></header>
-{{ else if .IsHome }}
-<header><h1>{{ .Site.Title }}</h1></header>
-{{ end }}
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
@@ -1,7 +1,5 @@
 <nav>
-  {{- if not .IsHome -}}
-  <a href="{{ .Site.Home.Permalink | relURL }}">{{ .Site.Title }}</a>&nbsp;|&nbsp;
-  {{- end -}}
+  <a href="{{ .Site.Home.Permalink | relURL }}"><b>{{ .Site.Title }}</b></a>&nbsp;|&nbsp;
   {{- range $i, $menu := .Site.Menus.main -}}
   {{- if (ge $i 1) -}}&nbsp;|&nbsp;{{- end -}}
   <a href="{{ $menu.URL | relURL }}">{{ $menu.Name }}</a>