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

github.com/pjbakker/flexible-seo-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul <paul@brainspark.nl>2020-04-01 18:11:40 +0300
committerPaul <paul@brainspark.nl>2020-04-01 18:12:33 +0300
commit8171f570ea8d08f259947f33e540d179363fe7ab (patch)
tree73ef8da14e97b2548d63a157f05e8405c3d698f6
parent6d47849fe84cb1b4ef4820575691b8fe84c8ca57 (diff)
Provide default terms layout
-rw-r--r--README.md1
-rw-r--r--layouts/_default/term.html0
-rw-r--r--layouts/_default/terms.html35
-rw-r--r--layouts/partials/header.html3
4 files changed, 39 insertions, 0 deletions
diff --git a/README.md b/README.md
index c7edaf7..b13437a 100644
--- a/README.md
+++ b/README.md
@@ -29,6 +29,7 @@ Within your `config.toml` add the according parameter you want the theme to use.
homeType = "simple"
navType = "simple"
headerType = "simple"
+ taxonomyHeaderType = "simple"
footerType = "simple"
~~~
diff --git a/layouts/_default/term.html b/layouts/_default/term.html
deleted file mode 100644
index e69de29..0000000
--- a/layouts/_default/term.html
+++ /dev/null
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
new file mode 100644
index 0000000..f1576ac
--- /dev/null
+++ b/layouts/_default/terms.html
@@ -0,0 +1,35 @@
+{{ define "main" }}
+
+{{ $data := .Data }}
+<div class="container" role="main">
+ <div class="col-lg-8 offset-lg-2 col-md-10 offset-md-1">
+ <article class="post-preview">
+ <div id="accordion" role="tablist" aria-multiselectable="true">
+ {{ range $key, $value := .Data.Terms.ByCount }}
+ <div class="card">
+ <button class="btn collapsed" role="button" data-toggle="collapse" data-target="#collapse{{ $value.Name }}" data-parent="#accordion" aria-expanded="false" aria-controls="collapse{{ $value.Name }}">
+ <div class="card-header" role="tab" id="header{{ $value.Name }}">
+ <h4 class="card-title">
+ {{ $value.Name }}
+ <span class="badge badge-secondary float-right">{{ $value.Count }}</span>
+ </h4>
+ </div>
+ </button>
+ <div id="collapse{{ $value.Name }}" class="card-collapse collapse" role="tabpanel" aria-labelledby="heading{{ $value.Name }}">
+ <div class="card-body">
+ <a href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/" class="list-group-item list-group-item-action view-all">
+ View all</a>
+ <div class="list-group">
+ {{ range $item := $value.WeightedPages }}
+ <a href="{{$item.Permalink}}" class="list-group-item list-group-item-action">{{ $item.Title }}</a>
+ {{ end }}
+ </div>
+ </div>
+ </div>
+ </div>
+ {{ end }}
+ </div>
+ </article>
+ </div>
+</div>
+{{ end }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 1892410..f8a0ede 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,3 +1,6 @@
{{- $header_type := .Params.headerType | default .Site.Params.headerType | default "simple" }}
+{{- if or ( eq .Kind "taxonomyTerm" ) ( eq .Kind "taxonomy" ) }}
+ {{- $header_type = .Site.Params.taxonomyHeaderType | default "simple" }}
+{{- end }}
{{- $header_file := printf "headers/%s.html" $header_type }}
{{- partial $header_file . }}