Skip to content

Commit

Permalink
Add gatsby-plugin-meta-redirect to Gatsby config. Disable trailing sl…
Browse files Browse the repository at this point in the history
…ashes
  • Loading branch information
jerboa88 committed Jun 30, 2024
1 parent c221675 commit 55d97eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const config: GatsbyConfig = {
siteMetadata: SITE_METADATA,
// Enable the new JSX transform so that we can use JSX without importing React
jsxRuntime: 'automatic',
trailingSlash: 'never',
graphqlTypegen: {
typesOutputPath: 'src/common/gatsby-types.d.ts',
},
Expand Down Expand Up @@ -141,6 +142,13 @@ const config: GatsbyConfig = {
},
},
},
// We are using a fork of gatsby-plugin-meta-redirect that supports disabling trailing slashes
{
resolve: 'gatsby-plugin-meta-redirect',
options: {
disableTrailingSlash: true,
},
},
],
};

Expand Down
4 changes: 2 additions & 2 deletions src/config/metadata/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import type { PagesMetadataConfig } from '../../common/types';

export const pagesMetadataConfig: PagesMetadataConfig = {
'/privacy-policy/': {
'/privacy-policy': {
title: 'Privacy Policy',
shortTitle: 'Privacy',
description:
'This privacy notice describes how and why johng.io might collect, store, use, and/or share your information',
},
'/404/': {
'/404': {
title: '404 - Page Not Found',
shortTitle: '404',
description: "Oof, there's nothing here",
Expand Down

0 comments on commit 55d97eb

Please sign in to comment.