layer5
layer5 copied to clipboard
[Static Assets] Apply withPrefix to brand asset downloads, add $external on case study PDF buttons, and improve modal accessibility
Description
Across several brand assets and collection case studies:
- Brand Kit Downloads Missing
withPrefix: In PR #8356,withPrefixwas added tolayer5.jsandbrand-guide.jsso that static asset downloads resolve correctly in PR preview deployments (PATH_PREFIX=pr-preview/pr-XYZ). However, 16 other brand kit download links insrc/sections/Company/Brand/still use plainhref="/brand/*.zip", causing 404s on preview builds. - Case Study PDF Buttons Missing
$external={true}: Insrc/collections/resources/case-study/*, the "Download Case Study" buttons link to static/case-studies/*.pdffiles but lack$external={true}. Without$external,Buttonwraps the download in Gatsby's<Link to="...">, attempting client-side SPA routing instead of downloading the static PDF. - Automatic
withPrefixin Button: UpdateButton(src/reusecore/Button/index.js) to automatically pass root-relative$externalURLs through Gatsby'swithPrefixso static file downloads (e.g. PDFs, slides) always resolve cleanly in both production and preview deployments. - Hardcoded Domain in Blog Post: In
src/collections/blog/2023/08-23-importance-of-github-stars/index.mdx, replacehttps://layer5.io/five/vol1/...with the site-relative path. - Modal Close Button Accessibility: Add
aria-label="Close modal"to theTeaserModalclose button (src/components/TeaserModal/index.js) so assistive technologies can identify the button.
Expected Behavior
- All static brand kit zip download links use
withPrefix. - Case study PDF buttons include
$external={true}and open as standard downloads. - Static asset buttons with root-relative paths automatically resolve using
withPrefix. TeaserModalclose button is accessible with anaria-label.
Affected Locations
src/reusecore/Button/index.jssrc/components/TeaserModal/index.jssrc/sections/Company/Brand/index.jssrc/sections/Company/Brand/Brand-components/*.js(15 components)src/collections/resources/case-study/*(3 case studies)src/collections/blog/2023/08-23-importance-of-github-stars/index.mdx