mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
feat(404): add collections 404 page to tech spotlights
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
a796facdb1
commit
849bd0be02
@@ -170,6 +170,10 @@ exports.onCreatePage = async ({ page, actions }) => {
|
||||
const oldPage = { ...page }
|
||||
page.matchPath = `/resources/*`
|
||||
deletePage(oldPage)
|
||||
} else if (page.path.match(/^\/archives\/404/)) {
|
||||
const oldPage = { ...page }
|
||||
page.matchPath = `/archives/*`
|
||||
deletePage(oldPage)
|
||||
} else {
|
||||
page.context.layout = resolveLayout(page.path)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { Location } from "@reach/router"
|
||||
import { graphql } from "gatsby"
|
||||
import React, { Fragment } from "react"
|
||||
|
||||
import { FileConnection } from "../../../generated/graphql"
|
||||
import { ComponentQuery } from "../../../typings"
|
||||
import { SEO } from "../../components/SEO"
|
||||
|
||||
import { getPossibleCorrections } from "../../components/404LinkCorrection"
|
||||
|
||||
export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => (
|
||||
<Fragment>
|
||||
<SEO title="404: Archive Not found" />
|
||||
<h1>RESOURCE NOT FOUND</h1>
|
||||
<p>You just hit a route that doesn't exist... the sadness.</p>
|
||||
<Location>
|
||||
{({ location }) => getPossibleCorrections("archives/", location, data, 8)}
|
||||
</Location>
|
||||
</Fragment>
|
||||
)
|
||||
|
||||
export const query = graphql`
|
||||
query {
|
||||
allFile(filter: { sourceInstanceName: { eq: "what-is-archive" } }) {
|
||||
edges {
|
||||
node {
|
||||
relativePath
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { Fragment } from "react"
|
||||
|
||||
import { Link } from "../components/Link"
|
||||
import { SEO } from "../components/SEO"
|
||||
import { Link } from "../../components/Link"
|
||||
import { SEO } from "../../components/SEO"
|
||||
|
||||
function ArchivesPage() {
|
||||
return (
|
||||
Reference in New Issue
Block a user