Skip to content

Commit

Permalink
content: nav pages (#267)
Browse files Browse the repository at this point in the history
* content: update images for colophon and disclosure pages

* content: template and content update for 404 page
  • Loading branch information
ajfisher authored Dec 7, 2024
1 parent e8df343 commit 09debc5
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 16 deletions.
6 changes: 4 additions & 2 deletions site/src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ export const Aside = styled.aside`
}
`;

const Layout = ({ children, title, excerpt, largetitle, smalltitle, slug}) => {
const Layout = ({ children, title, excerpt, featuredimage, largetitle, smalltitle, slug}) => {

return (
<>
<Header title={title} excerpt={excerpt}
largetitle={largetitle} smalltitle={smalltitle}/>
largetitle={largetitle} smalltitle={smalltitle}
featuredimage={featuredimage}
/>
<Main>
<Article>
{children}
Expand Down
4 changes: 3 additions & 1 deletion site/src/content/pages/colophon.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ author: ajfisher
date: 2020-01-31 10:00:10+10:00
layout: page
slug: colophon
title: Colophon
title: Colophon - how this site was built.
featureimage: ../../img/posts/colophon.png
imageby: ajfisher - Flux.Dev
---

If you want to know a little more about how this site is constructed, the
Expand Down
2 changes: 2 additions & 0 deletions site/src/content/pages/dis-everything.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ layout: page.hbt
slug: dis-everything
large-title: true
title: Disclaimer & Disclosure
featureimage: ../../img/posts/disclosure.png
imageby: ajfisher - Flux.Dev
---

As bloggers are generally quite anonymous I think we should disclose any of our
Expand Down
Binary file added site/src/img/posts/404_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/src/img/posts/colophon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/src/img/posts/disclosure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 40 additions & 13 deletions site/src/pages/404.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Link } from 'gatsby';
import { Link, graphql } from 'gatsby';

import Layout from '../components/layout';
import PageHead from '../components/page-head';
Expand All @@ -8,36 +8,63 @@ export const Head = () => {
return (
<>
<PageHead
title="This page cannot be found | ajfisher"
title="This page cannot be found"
description="The page you requested does not exist or has moved."
type="website"
/>
</>
);
};

const NotFoundPage = ({location}) => {
const NotFoundPage = ({location, data}) => {
const { featureimage } = data?.headimage?.nodes[0];

const featuredImage = featureimage || null;

const title = 'This page cannot be found';
const slug = '/404';
const excerpt = `Sometimes life is hard and doesn't give us what we want. This is one of those times. The page you have requested does not exist or has moved somewhere else.`;
const excerpt = `Hmmm, this is awkward. The page you’re looking for vanished into the ether or never existed in the first place. Either way, it’s not here. Let’s find you something better!`;

return (
<Layout slug={slug} title={title} excerpt={excerpt} largetitle="true" >
<Layout slug={slug} title={title} excerpt={excerpt}
largetitle="true" featuredimage={featuredImage}
>
<PageHead title={title}/>
<section class="content">
<p>You made a request for <strong>{location.pathname}</strong>.</p>
<p>Unfortunately this page doesn't exist or has been permanently moved
somewhere else without a redirection.</p>
<p>This page doesn't exist or has been moved permanently.</p>

<h2>Where to next?</h2>
<p>Going back to the <Link to="/">home page</Link> will show you featured
articles and recent posts.</p>
<p>You can also <Link to="/who">learn about ajfisher</Link> if
you want to find out more about what he does and where he works.</p>
<p>Finally, if nothing else, you can check out <Link to="/blog">the full
list of articles</Link> that have ever been published.</p>
<p>
1. <Link to="/">Go to the home page</Link>: Check out recent articles
and featured content.
</p>
<p>
2. <Link to="/who">Learn more about ajfisher</Link>: Find out what I
do and how I do it.
</p>
<p>
3. <Link to="/blog">Explore all articles</Link>: Peruse the complete
archive of published content.
</p>
</section>
</Layout>
);
};

export default NotFoundPage

export const pageQuery = graphql`
query {
headimage: allImageSharp(
filter: {original: {
src: {regex: "/404_page/"}
}}
) {
nodes {
id
featureimage: gatsbyImageData(layout: FULL_WIDTH)
}
}
}
`;

0 comments on commit 09debc5

Please sign in to comment.