Repository navigation
CtaImage: support custom destinations - #5901
Conversation
✅ Deploy Preview for flowfuse-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@sumitshinde-84 this overlaps with #5860, opened in response to what ZJ was asking in #5857 (comment). Would you mind reviewing that one first? It already has a more robust reserved-destination check ( Once #5860 lands, please rework this one on top of that. |
Reworked on top of #5860: reserved destinations are matched with ctaDestinationKey, and every ::cta-image in the content tree is checked in npm test instead of only at render time.
2445b92 to
6612551
Compare
Co-authored-by: Yndira Escobar <129537638+Yndira-E@users.noreply.github.com>
|
Would it make sense for custom image CTAs to reference an entry in For example: The registry could provide the destination URL and its event. On click, WDYT? |
cta="custom" now takes a destination-key into the shared registry instead of a free-form href. The registry supplies the URL and the destination event, fired with position inline-image and variant image, alongside blog-cta with destination_key. Only entries with a fixed href are accepted.
Thanks @Yndira-E, applied! cta="custom" now takes a destination-key into CUSTOM_CTA_DESTINATIONS instead of a free-form href. The registry supplies the URL and event; on click it fires the destination's event (position: 'inline-image', variant: 'image') plus blog-cta with the article reference and destination_key. Dynamic-URL entries are rejected for now, and npm test checks every ::cta-image in content. Ready for another look. |
|
Thanks @sumitshinde-84 Nice work. Putting the rules in
|
Link custom images with external, fix the handbook example and indent, scope the CtaLink note in CLAUDE.md, and resolve custom images in the RSS feed.
|
Thanks for the review, all your points are addressed ! On the external link question, I handled it now: the custom ULink gets external, the same default as CtaCustom, so it always does a full page load. I also found that the RSS feed has its own copy of the image destinations, so a custom image would have appeared there without a link. It now gets its link from the registry too. |

Description
::cta-imagecould only link to the four fixed destinations (sign-up, demo, contact, pricing). This addscta="custom", which links to an entry inCUSTOM_CTA_DESTINATIONS, so an inline image CTA can point at a blueprint, another blog post, a docs page, or a product page.cta="custom"requires adestination-keyfromnuxt/lib/custom-cta-destinations.ts, the same registryCtaCustomuses. Adestination-keyon any otherctavalue is an error.href, and the registry's own self-check already rejects reserved destinations and duplicate URLs.hrefare accepted. Dynamic-URL entries (e.g.latestWebinar) are rejected for now and can be handled separately.{ position: 'inline-image', variant: 'image' }, plusblog-ctawith the articlereference,cta_type: customanddestination_key. No URL is sent to PostHog.CtaLink, unchanged.nuxt/lib/cta-image.ts.nuxt/lib/cta-image.test.mjschecks every::cta-imagein the content tree against them, so a bad one failsnpm test, not just the page render.marketing/content-strategy/blog) and.claude/CLAUDE.mddocument the new option.