hugo-soresu

My fork of hugo-xmin

git clone git://git.shimmy1996.com/hugo-soresu.git
commit 6b4216ce56c7dedad88b9fb5f1e15a99d40bbc0b
parent dad4ec6309815449445ed339735c5bdf67b79799
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sat, 26 May 2018 00:39:00 -0500

Create a new layout for home page.

Diffstat:
Alayouts/_default/home.html | 13+++++++++++++
Mlayouts/_default/list.html | 13+++----------
Mlayouts/_default/single.html | 2--
Mlayouts/_default/terms.html | 1-
Mlayouts/partials/comment.html | 1+
Mlayouts/partials/footer.html | 1+
Mstatic/css/style.css | 21+++++++++++----------
7 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/layouts/_default/home.html b/layouts/_default/home.html
@@ -0,0 +1,13 @@
+{{ partial "header.html" . }}
+
+<h1>{{ .Site.Params.title }}</h1>
+{{ with .Site.Params.subtitle }}<span class="subtitle">{{.}}</span>{{ end }}
+
+<main>{{ .Content }}</main>
+
+<ul>
+{{ range (first 5 (where .Data.Pages "Section" "!=" "") ) }}
+  <li><span class="date">{{ .Date.Format "2006-01-02" }}</span> <a href="{{ .URL }}">{{ .Title }}</a></li>
+{{ end }}
+
+{{ partial "footer.html" . }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -1,19 +1,12 @@
 {{ partial "header.html" . }}
-{{ if not .IsHome }} {{ partial "i18n_title.html" . }} {{ end }}
+{{ partial "i18n_title.html" . }}
 
 <main>{{ .Content }}</main>
 
 <ul>
-{{ if .IsHome }}
-  {{ range (first 5 (where .Data.Pages "Section" "!=" "") ) }}
-    <li><span class="date">{{ .Date.Format "2006-01-02" }}</span> <a href="{{ .URL }}">{{ .Title }}</a></li>
-  {{ end }}
-{{ else }}
-  {{ range (where .Data.Pages "Section" "!=" "") }}
-    <li><span class="date">{{ .Date.Format "2006-01-02" }}</span> <a href="{{ .URL }}">{{ .Title }}</a></li>
-  {{ end }}
+{{ range (where .Data.Pages "Section" "!=" "") }}
+  <li><span class="date">{{ .Date.Format "2006-01-02" }}</span> <a href="{{ .URL }}">{{ .Title }}</a></li>
 {{ end }}
 </ul>
 
-<hr/>
 {{ partial "footer.html" . }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -19,7 +19,5 @@
 
 <main>{{ .Content }}</main>
 
-<hr/>
 {{ partial "comment.html" . }}
-<hr/>
 {{ partial "footer.html" . }}
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
@@ -9,5 +9,4 @@
 {{ end }}
 </ul>
 
-<hr/>
 {{ partial "footer.html" . }}
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html
@@ -1,3 +1,4 @@
+<hr/>
 <script data-isso="/isso/"
         data-isso-css="false"
         data-isso-lang={{ .Site.Language }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
@@ -1,3 +1,4 @@
+<hr/>
 <footer>
   {{ partial "include_js.html" . }}
   {{ with .Site.Copyright }} {{ . | markdownify }} {{ end }}
diff --git a/static/css/style.css b/static/css/style.css
@@ -16,9 +16,16 @@ body {
 }
 .menu, .article-meta, footer { text-align: center; }
 .title { font-size: 1.1em; line-height: 1.1em;}
-footer a { text-decoration: none; }
-hr {
-  border: 1px dashed #ddd;
+
+hr { border: 1px dashed #ddd; }
+.subtitle {
+    color: #700000;
+    font-style: italic;
+}
+
+a {
+  text-decoration:none;
+  color: #700000;
 }
 
 /* code */
@@ -48,16 +55,10 @@ table {
   margin: auto;
   overflow: hidden;
 }
-table thead th {
-}
+table thead th {}
 th, td {
   padding: 5px;
 }
 thead, tfoot, tr:nth-child(even) {
   background: #ccc;
 }
-
-a {
-  text-decoration:none;
-  color: #700000;
-}