Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/J-Siu/hugo-theme-sk1.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Siu (imacpro) <john.sd.siu@gmail.com>2020-07-02 21:28:43 +0300
committerJohn Siu (imacpro) <john.sd.siu@gmail.com>2020-07-02 21:28:43 +0300
commit3572a8a65d4355d13c7b213114b97a13f684324e (patch)
tree4ede20686f937bad0029d93940a817b6fcead4fd
parent0b38897dcfdddc1fed91cef0f7818485cb4a009c (diff)
Add comment and minor update
-rw-r--r--layouts/_default/list.html15
-rw-r--r--layouts/_default/single.html18
-rw-r--r--layouts/partials/header.html2
3 files changed, 24 insertions, 11 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 5a5b443..1923e23 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,23 +1,24 @@
{{define "main"}}
-{{if .Site.Params.mainType}}
- {{.Scratch.Set "type" .Site.Params.mainType}}
-{{else}}
- {{.Scratch.Set "type" "post"}}
-{{end}}
+<!--Set type-->
+{{.Scratch.Set "type" (default "post" .Site.Params.mainType)}}
+<!--Set paginator base on .IsHome and "type"-->
{{if .IsHome}}
- {{.Scratch.Set "Paginator" (.Paginate (where .Site.RegularPages "Type" (.Scratch.Get "type")))}}
+{{.Scratch.Set "Paginator" (.Paginate (where .Site.RegularPages "Type" (.Scratch.Get "type")))}}
{{else}}
- {{.Scratch.Set "Paginator" .Paginator}}
+{{.Scratch.Set "Paginator" .Paginator}}
{{end}}
{{$paginator:=(.Scratch.Get "Paginator")}}
+
+<!--list-->
<ul>
{{range $paginator.Pages}}
<li>{{.Date.Format "2006-01-02"}} | <a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{end}}
</ul>
+<!--pagination-->
{{template "_internal/pagination.html" .}}
{{end}} \ No newline at end of file
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 2ce0fa8..9010f40 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,25 +1,35 @@
{{define "main"}}
+<!--Title-->
<h2>{{.Title}}</h2>
+
+<!--Date-->
{{.Date.Format "2006-01-30"}}
+
+<!--TOC-->
{{.TableOfContents}}
+
+<!--Content-->
{{.Content}}
+<!--Tag-->
<ul>
{{range (.GetTerms "tags")}}
- <li><a href="{{.RelPermalink}}">{{.LinkTitle}}</a></li>
+ <li><a href="{{.RelPermalink}}">{{.LinkTitle}}</a></li>
{{end}}
</ul>
-{{with .PrevInSection}}<a href="{{.RelPermalink}}">{{.Title}}</a>{{end }}
-{{with .NextInSection}}<a href="{{.RelPermalink}}">{{.Title}}</a>{{end }}
+<!--Prev/Next-->
+{{with .PrevInSection}}Prev <a href="{{.RelPermalink}}">{{.Title}}</a>{{end}}
+{{with .NextInSection}}Next <a href="{{.RelPermalink}}">{{.Title}}</a>{{end}}
+<!--Related-->
{{$related := .Site.RegularPages.Related . | first 5}}
{{with $related}}
<h3>See Also</h3>
<ul>
{{range .}}
- <li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
+ <li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{end}}
</ul>
{{end}}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index bf161ee..137fac4 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,2 +1,4 @@
+<!--Site Title-->
<a href="{{ "" | relLangURL}}">{{.Site.Title}}</a>
+<!--Sub-title-->
{{with .Site.Params.subtitle}} / {{.}}{{end}} \ No newline at end of file