Commit affdfce2 authored by key-amb's avatar key-amb
Browse files

Add category-pages to sidebar of single-page

parent 8b08a606
{{ $baseUrl := .Site.BaseURL }}
{{ $url := .Permalink }}
<div class="col-sm-3 col-sm-offset-1 doc-sidebar">
<div id="sidebar">
<div class="sidebar-module">
<div class="sidebar-toc">
<h4>Table of Contents</h4>
<h4 class="sidebar-heading">Table of Contents</h4>
<ul>
<li><strong><a href="#title">{{ .Title }}</a></strong></li>
</ul>
......@@ -11,7 +12,26 @@
</div>
</div>
<div class="sidebar-module">
<h4>Tags</h4>
<h4 class="sidebar-heading">Pages in Categories</h4>
<ul class="sidebar-category-list">
{{ range $name, $taxonomy := .Site.Taxonomies.categories }}
<li>
<a href="{{ $baseUrl }}/categories/{{ $name | urlize }}">
<span class="doc-list-category">{{ $name | title }}</span>
</a>
<ul>{{ range $taxonomy.Pages }}
<li>{{ if eq $url .Permalink }}
<span class="active">{{ .Title }}{{ if .Draft }} #Draft{{ end }}</span>
{{ else }}<a href="{{ .RelPermalink }}">{{ .Title }}{{ if .Draft }} #Draft{{ end }}</a>
{{ end }}</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
</div>
<div class="sidebar-module">
<h4 class="sidebar-heading">Tags</h4>
<div class="tag-box">
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
<a class="tag-item" href="{{ $baseUrl }}/tags/{{ $name | urlize }}">{{ $name }}</a>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment