Where to put content type description for use on archive page?

I have a number of content types in my site, posts, notes and tweets. These are all defined by using a directory with posts inside.


When viewing the /layouts/content-type/list.html template, I see I can use .Description, but where do I store that description?

In the _index.md file of every section, either as a front matter variable or as content.

An example for front matter using YAML

title: "Posts"
description: Lorem ipsum dola sit amet.

Then call {{ .Params.description }} in your list template.

An example using content

title: "Posts"
Lorem ipsum dola sit amet.

Then add {{ .Content }} in your list template.

@steppa Thanks, I couldn’t find this in the docs.
I didn’t know about the _index.md file, now I do :smile:

See content management

If you need to get the title/description outside list templates, you do something like below

{{ with site.GetPage "posts/" }}
{{ .Title }} - {{ .Params.description }}
{{ end }}
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.