How to query tag in to getStaticPaths

I make tag manual it’s still work but i don’t want to make it manual. Can i query all tag and store in params ?

Hi @mbandit001, you can query all the tags in your repository by hitting the api endpoint of your repo:

import Prismic from 'prismic-javascript';

const apiObject = await Prismic.api("")

The results returned from that call will include a list of tags.

It’s work, But i have some problem. In my post have multi tag like “tag1”, “tag2” but render result is “tag1tag2” . How to fix it ?

Can you show me how you’re rending the tags onto the page?

In first post have 1 tag. And Fourth post have 2 tag.


What is the code you’re using to render the tags?

I use {(post.tags)} render tag.



Okay well you’ll likely need to loop over the tags array (or use the map) to render them as separate tags on the page.

Something like this example from the Next.js docs.

This issue has been closed due to inactivity.