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

github.com/mazgi/hugo-theme-techlog-simple.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHidenori MATSUKI <MATSUKI.Hidenori@gmail.com>2018-10-04 21:04:06 +0300
committerHidenori MATSUKI <MATSUKI.Hidenori@gmail.com>2018-10-04 21:04:06 +0300
commita4ac062f46d3c2042176be33f531156f46d1ab95 (patch)
tree42aea40812a36a9073549e83fa24d62e9335cbd2
parent54f22f42eae9c20d2f4177c1711d12fdecba6c34 (diff)
Show authors each page.
-rw-r--r--layouts/_default/list.html38
-rw-r--r--layouts/partials/header.html11
-rw-r--r--layouts/taxonomy/author.terms.html16
3 files changed, 51 insertions, 14 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 9a36e45..e7b1e23 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,6 +1,18 @@
{{ partial "header.html" . }}
<div class="row">
<div class="col-lg-9">
+ {{ if and ( eq .Kind "taxonomy" ) ( eq .Type "authors" ) }}
+ <div class="row">
+ <h2>{{ .Name }}'s articles</h2>
+ </div>
+ {{ with ( .Site.GetPage "page" ( printf "profiles/%s" ( lower .Name ) ) ) }}
+ <div class="row">
+ {{ .Content }}
+ </div>
+ <hr/>
+ {{ end }}
+ {{ end }}
+
{{ $paginator := .Paginate ( .Data.Pages ) }}
{{ range $idx, $page := $paginator.Pages }}
{{ if $page.Section }}
@@ -9,20 +21,17 @@
<h3><a href="{{ .RelPermalink}}">{{ .Title }}</a></h3>
</div>
<div class="row">
- <div class="col-lg-3">
- <p>Updated At: {{ .Lastmod.Format "2006.01.02" }}</p>
- </div>
- <div class="col-lg-9">
- {{ if .Params.Authors }}
- <p>Author(s):
- {{ with .Params.Authors }}
- {{ range . }}
- <a class="ml-1 badge badge-pill badge-secondary" href="{{ "/authors/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
- {{ end }}
- {{ end }}
- </p>
- {{ end }}
- </div>
+ <span class="ml-1">Created At: {{ .Date.Format "2006.01.02" }}</span>
+ <span class="ml-1">Updated At: {{ .Lastmod.Format "2006.01.02" }}</span>
+ {{ if .Params.Authors }}
+ <span class="ml-1">Author(s):
+ {{ with .Params.Authors }}
+ {{ range . }}
+ <a class="ml-1 badge badge-pill badge-secondary" href="{{ "/authors/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
+ {{ end }}
+ {{ end }}
+ </span>
+ {{ end }}
</div>
<div class="row">
{{ .Summary }}
@@ -40,6 +49,7 @@
{{ end }}
{{ partial "pagination.html" . }}
</div>
+
<div class="col-lg-3">
{{ partial "sidebar.html" . }}
</div>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 1b19cdb..dff87a9 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -87,6 +87,17 @@
</li>
{{ end }}
{{ if not .IsNode }}
+ {{ if .Params.Authors }}
+ <li class="nav-item">
+ <span class="nav-link disabled">Author(s):
+ {{ with .Params.Authors }}
+ {{ range . }}
+ <a class="ml-1 badge badge-pill badge-secondary" href="{{ "/authors/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
+ {{ end }}
+ {{ end }}
+ </span>
+ </li>
+ {{ end }}
<li class="nav-item">
<span class="nav-link disabled">Created At: {{ .Date.Format "2006.01.02" }}</span>
</li>
diff --git a/layouts/taxonomy/author.terms.html b/layouts/taxonomy/author.terms.html
new file mode 100644
index 0000000..e4580ed
--- /dev/null
+++ b/layouts/taxonomy/author.terms.html
@@ -0,0 +1,16 @@
+{{ partial "header.html" . }}
+<div class="row">
+ <div class="col-lg-9">
+ {{ $plural := .Data.Plural }}
+ {{ range $key, $value := .Data.Terms }}
+ <a class="m-1 btn btn-lg btn-secondary badge-pill" href="{{ "/" | relLangURL}}{{ $plural }}/{{ $key | urlize }}">
+ {{ $key }}
+ <span class="badge badge-light">{{ len $value }}</span>
+ </a>
+ {{ end }}
+ </div>
+ <div class="col-lg-3">
+ {{ partial "sidebar.html" . }}
+ </div>
+</div>
+{{ partial "footer.html" . }}