Let’s say for example that I have ‘How To’ and ‘Tags’. I would like to add a short description at the top of the page preferably in markdown. Do I just hard code it with html inside terms.html or is there a way I can use markdown and use {{.Content}} ?
Add it to terms.html like this ?
<h2>Introduction</h2>
<p>I have something to say about 'How To' and 'Tags' right here.</p>
Or is there a markdown file I could use like _terms.md ?
## Introduction
I Have something to say about 'How To' and 'Tags' right here.
Render the markdown inside the html could also be a possibility. With a single.html and list.html I can easily render content with index.md and _index.md, is there something for taxonomy markdown that I can use? I only have a few taxonomies but I could see how it would require some automation for someone who has lot of them. Rendering different pages for different terms.
Thanks, that makes sense. What if I wanted to add the same paragraph {{.Content}} to all the terms?
Just leave this in terms.html?
<p>This is a paragraph that I want in all the term pages. </p>
I can’t create a terms/_index.md, I don’t think that is vaild. However, what you mentioned does work for individual terms like tags/_index.md and categories/_index.md. I could just do if page is terms render this content, partial, or markdown…
+++
title = "Tags"
date = 2021-04-04T21:53:17-07:00
draft = false
termContent = "Labore commodo non est tempor Lorem aute occaecat ad nostrud. Laboris non occaecat sint occaecat pariatur eu. Eu reprehenderit ex ipsum sit commodo veniam velit ad et ex in commodo. Cupidatat ipsum et non nostrud exercitation nulla nulla fugiat quis est aliquip. Qui nisi sunt nostrud excepteur sint nostrud do aliquip eu eu eiusmod ut nulla laboris."
+++
This is content/tags/_index.md
layouts/_default/term.html
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Parent.Params.termContent }}
{{ range .Pages }}
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ end }}
Your solution solves my problem but what’s the difference in _default/taxonomy.html and _default/terms.html ? It looks like I can modify both ‘categories’ and ‘tags’ with any of these templates.