Featured image of post Custom Taxonomy

Custom Taxonomy

How to Guide For Future Me or anyone interested

Step 1

Make a new _index.md file in a content folder of the name of the new Custom Taxonomy - something like this for Colours:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
---
title: Colours
description: View all colours
image:
link: "/colours/"
layout: list


style:
    background: "#2a9d8f"
    color: "#fff"

menu:
    main:
        name: Colours
        weight: 5
        params:
            icon: colour
---

Step 2

In the config.toml file make sure you define the taxonomy

1
2
3
4
5
[taxonomies]
  tag = "tags"
  category = "categories"
  brand = "brand"
  colour = "colours"

Step 3

Ensure some of the posts you want to show up are assigned the new taxonomy

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
---
title: "Bic Criterium"
description: 2mm Silver
image: Criterium.png
categories:
    - Mechanical Pencil
    - 2mm
    - Plastic
tags:
    - 2mm
params:
    icon: pencil
Brand: 
- Bic
Colours:
- Silver
---

Step 4

Restart the server to apply the new taxonomies

Licensed under CC BY-NC-SA 4.0
© Based on the marvellous Stack template by Jimmycai
Parallax stars effect by Sarazond, grid background by Temani Afif