layer5
layer5 copied to clipboard
[Bug] Replace Gatsby Link with anchor tags for static PDF downloads and fix non-canonical routes
Description
In several places across the website, Gatsby's <Link> component (import { Link } from "gatsby") is used to link directly to static .pdf files (such as /brand/brand-guide.pdf and /brand/bookmarks.pdf):
// src/sections/Company/Brand/Brand-components/brand-guide.js
<Link to="/brand/brand-guide.pdf">
<img className="bookmarks" src={BrandGuideImg} alt="Layer5 Brand Guide" />
</Link>
In Gatsby, <Link> is reserved for internal client-side single page app (SPA) routing. When a user clicks a <Link> targeting a static file, Gatsby's client-side router attempts to resolve the URL as a page component, which fails and navigates to the 404 page instead of opening or downloading the file.
In addition, several UI components link to old/redirected paths (/brand and /kanvas) instead of the canonical routes (/company/brand and /cloud-native-management/kanvas).
Affected Files
src/sections/Company/Brand/Brand-components/brand-guide.js(line 48: static PDF link)src/sections/Company/Brand/Brand-components/layer5.js(line 125: static PDF link)src/sections/Projects/Sistent/getting-started/about/index.js(lines 83, 86: static PDF link and/brandroute)src/sections/Company/News-grid/press.js(line 92:/brandroute)src/sections/Company/News-single/Sidebar.js(lines 103, 114:/brandand/kanvasroutes)src/sections/Community/Member-single/index.js(line 198:/kanvasroute)
Expected Behavior
- Links to static
.pdfassets should use standard<a>tags withtarget="_blank"andrel="noreferrer". - Internal page links should use canonical paths (
/company/brandand/cloud-native-management/kanvas).
Environment
- Host OS: Any
- Browser: Any