sapper-blog-template
sapper-blog-template copied to clipboard
Add tags support
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
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
---