sapper-blog-template icon indicating copy to clipboard operation
sapper-blog-template copied to clipboard

Add tags support

Open Charca opened this issue 5 years ago • 1 comments

I'm thinking we could add a new tags front-matter variable to filter posts by tag, something like:

---
title: Hello World 👋
date: "2019-06-11T08:38:00.000Z"
tags: design, random
---

And then create a new route, similar to blog/index, but to filter posts by tag:

/blog/tag/[slug].svelte
/blog/tag/[slug].json.js

Charca avatar Jan 11 '20 20:01 Charca

To output the tags as an array from the front matter you should format like this:

---
title: Hello World 👋
date: "2019-06-11T08:38:00.000Z"
tags:
  - design
  - random
---

JHethDev avatar Jan 30 '20 09:01 JHethDev