Primary Tag on Home page [Gatsby Ghost]


I want to display Primary Tag on My Home page
I Modified the Tag functions on postCard.js file but it’s not working
If i add separately it working {}

[Gatsby Ghost Starter] How to add new static pages?

Hey @mskian :wave:t3:

Do I understand correctly, that you want to only show the primary tag of your posts instead of all tags?

We are still in the process of moving our helpers from Ghost Core into a more generic JavaScript SDK, but this is not ready yet and therefore you’ll not find documentation for it.

Nevertheless, you can see a couple of examples on how we use the Tags helper within the starter. The first one is here already

and that’s probably the one you’d like to update. This is the Gatsby helper and can be used within the component, as it’ll render you HTML.

Another usage of the tags helper can be found here:

This example shows how the helper can be used for its functionality only without rendering HTML.

As mentioned, the usage is not yet documented for Gatsby, but has the same functionality as the original tags helper from Ghost core, which is described here:

That said, if you’d like to use only the primary tags for your post cards, you should be able to change the helper here to this:

<Tags post={post} limit={1} visibility="public" autolink={false} />

Hope that helps!

closed #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.