Open elijames-codecov opened 1 week ago
Assigning to @getsentry/support for routing ⏲️
@elijames-codecov we can have banners across all pages easily reusing the same component (and dismissibility) behavior
what would an ideal fine grained control over which pages to show a certain banner look like from an author's POV / dream DX?
@elijames-codecov we can have banners across all pages easily reusing the same component (and dismissibility) behavior
what would an ideal fine grained control over which pages to show a certain banner look like from an author's POV / dream DX?
@a-hariti - if you look at static-sites' banner, we list each page or directory we want each banner to appear in. If we can mimic that functionality, that would keep it consistent which makes it easier to maintain. Here's a code snippet of how this is currently controlled on static-sites. The appearsOn
property determines where the particular banner is located.
const BANNERS = [ { appearsOn: ['^/from/self-hosted'], text: 'Atlassian migrated to Sentry SaaS and scaled their developer efficiency in just a few days - see how in our on-demand workshop.', linkURL: 'https://sentry.io/resources/upgrading-vs-migrating-atlassian-workshop/?promo_name=from-banner', linkText: 'Watch here.', }, { appearsOn: ['^/for/laravel', '^/for/php'], text: 'Join us for a live discussion and demo with Lavarel experts on Oct. 22.', linkURL: 'https://sentry.io/resources/behind-the-code-laravel-experts/?promo_name=from-banner', linkText: 'RSVP', }, { appearsOn: ['^/answers', '^/for/open-source', '^/for/good', '^/for/python', '^/for/django'], text: 'We’ve been feasting at the Open Source table without paying the maintainers for too long. The Open Source Pledge is looking to change that.', linkURL: 'https://opensourcepledge.com/', linkText: 'Will you join us?', }, ];
Nice pattern!
Can you give the repo where it's being used?
Nice pattern!
Can you give the repo where it's being used?
static-sites
. The repo and directory location of the file is in the description.
I think this repo is not visible to me
Problem Statement
Since the docs are great for boosting our SEO traffic, I was wondering if we could extend the promo banner beyond the homepage.
Currently, it's managed through
src/components/banner
with no real option on which page we would like to target, and based on the codebase, it's only published on the docs homepage (though please let me know if I'm missing something).Solution Brainstorm
We would like the following functionality:
src/components/banner/index.tsx
As an example of general functionality, it can be found on
static-sites
(packages/shared/components/Banner
).