I’ve been working on this for the better part of today and am still rather lost. I’ve found some posts that I think pointed me in the right direction but didn’t actually solve the problem I’m facing. I’m creating a blog that will contain a variety of content and one subject is some Dungeons & Dragons campaigns. I’ve created a custom taxonomy called dnd
that stores the name of the campaign for displaying on the page and I want to group posts by that taxonomy. I’ve gotten it somewhat working but the name doesn’t display well. In my frontmatter, I have this:
dnd:
- Penance & Redemption
or
dnd:
- New one
^ this is just placeholder text for a new campaign I started yesterday
Those titles, however, are displayed on the page as shown below.
new-one
and penance-redemption
is all I’m concerned with; why is the “normal” value of dnd
(New one
and Penance & Redemption
) not displayed properly?
{{ if eq $title "Dungeons & Dragons" }}
{{ range $key, $taxonomy := .Site.Taxonomies.dnd }}
<div class="posts-group">
<div class="post-year">{{ $key }}</div>
<ul class="posts-list">
{{- range $taxonomy.Pages }}
<li class="post-item">
<a href="{{.Permalink}}">
<span class="post-title">{{.Title}}</span>
<span class="post-day">{{ if .Site.Params.dateformShort }}{{ .Date.Format .Site.Params.dateformShort }}{{ else }}{{ .Date.Format "Jan 2"}}{{ end }}</span>
</a>
</li>
{{- end }}
</ul>
</div>
{{ end }}
{{ end }}