Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags in Swyxkit #174

Closed
swyxio opened this issue Jan 18, 2023 · 0 comments
Closed

Tags in Swyxkit #174

swyxio opened this issue Jan 18, 2023 · 0 comments

Comments

@swyxio
Copy link
Owner

swyxio commented Jan 18, 2023


tags: changelog

Swyxkit has basically always had a tagging system in the schema, but we just never used it:

https://github.com/sw-yx/swyxkit/blob/f49d61b0d4d5dfa4aa305c29e57be850d530f6a8/src/lib/content.js#L237-L239

You specify it in frontmatter (like in this post) as a simple comma separated string:

---
tags: comments, utterances, github cms
---

or as a yaml array of strings

---
tags: 
	- comments
	- utterances
	- github cms
---

Tags are alternatives to categories, which are singletons that have special meaning (different layouts, dedicated filters).

Blog index

First thing to do was to modify <IndexCard to display them:

image

of course we also needed to test and defensively guard against too many tags...

image

individual blogposts

then display them on the post in a way that is robust to overtagging:

image

search

then make each link back to search.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant