aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2019-12-19 17:22:12 +0100
committerAlex Shpak <alex-shpak@users.noreply.github.com>2019-12-19 17:22:12 +0100
commitd6290dcf509c84a38df667813ad3acdcf58c09f5 (patch)
tree8cc7c6134148e24df3c12589b7faa12cadf4fb71 /layouts/partials
parentf5a52e6ed124526ebd070480068e6e145af11d9a (diff)
#66, add taxonomy support
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/docs/post-meta.html18
-rw-r--r--layouts/partials/docs/taxonomy.html20
2 files changed, 38 insertions, 0 deletions
diff --git a/layouts/partials/docs/post-meta.html b/layouts/partials/docs/post-meta.html
new file mode 100644
index 0000000..37b6080
--- /dev/null
+++ b/layouts/partials/docs/post-meta.html
@@ -0,0 +1,18 @@
+{{ $dateFormat := default "January 2, 2006" .Site.Params.BookDateFormat }}
+{{ if or .Date .Params.tags }}
+<div>
+{{ with .Date}}
+ <h5>{{ .Format $dateFormat }}</h5>
+{{ end }}
+
+{{ range $term, $_ := .Site.Taxonomies }}
+ {{ with $list := index $.Params $term }}
+ {{ range $n, $single := $list }}{{ if $n }}, {{ end -}}
+ <a href="/{{$term}}/{{$single}}/">{{ $single }}</a>
+ {{- end }}
+ <br />
+ {{ end }}
+{{ end }}
+
+</div>
+{{ end }}
diff --git a/layouts/partials/docs/taxonomy.html b/layouts/partials/docs/taxonomy.html
new file mode 100644
index 0000000..f2c00d5
--- /dev/null
+++ b/layouts/partials/docs/taxonomy.html
@@ -0,0 +1,20 @@
+<aside class="book-toc fixed">
+<nav>
+ <ul>
+ {{ range $term, $_ := .Site.Taxonomies }}
+ {{ with $.Site.GetPage (printf "/%s" $term) }}
+ <li class="book-section-flat">
+ <strong>{{ .Title | title }}</strong>
+ <ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .RelPermalink }}">{{ .Title }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ </li>
+ {{ end }}
+ {{ end }}
+ </ul>
+</nav>
+</aside>