fix: show categories on posts
Add a categories.html partial that renders linked Hugo categories terms
using the same styling pattern as tags, and include it before tags on
single pages.
Add a global `ananke.show_categories` switch (default true) to toggle
the category display; set it to false to hide categories site-wide.
Closes #620
2 files modified
1 files added
| | |
| | | [ananke] |
| | | show_recent_posts = true # show recent posts on the homepage |
| | | show_categories = true # show categories terms on single pages |
| | | |
| | | [ananke.home] |
| | | content_alignment = "center" # options: left, center, right |
| New file |
| | |
| | | {{- /* Show category terms on single pages unless disabled via site.Params.ananke.show_categories = false */ -}} |
| | | {{- if not (eq false site.Params.ananke.show_categories) -}} |
| | | <ul class="pa0"> |
| | | {{ range .GetTerms "categories" }} |
| | | <li class="list di"> |
| | | <a href="{{ .RelPermalink }}" class="link f5 grow br-pill ba ph3 pv2 mb2 dib black sans-serif no-underline"> |
| | | {{- .LinkTitle -}} |
| | | </a> |
| | | </li> |
| | | {{ end }} |
| | | </ul> |
| | | {{- end -}} |
| | |
| | | {{- partials.Include "hook.html" (dict "hook" "content-before" "context" .) -}} |
| | | {{- .Content -}} |
| | | {{- partials.Include "hook.html" (dict "hook" "content-after" "context" .) -}} |
| | | {{- partials.Include "categories.html" . -}} |
| | | {{- partials.Include "tags.html" . -}} |
| | | {{ if .Site.Config.Services.Disqus.Shortname }} |
| | | <div class="mt6 instapaper_ignoref"> |