Skip to content

Commit

Permalink
Merge pull request #149 from thisdot/feat-seo
Browse files Browse the repository at this point in the history
...SEO
  • Loading branch information
hdJerry authored Jul 25, 2023
2 parents 48824d4 + ef0fb8e commit 062f420
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
5 changes: 5 additions & 0 deletions app/[not_found]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Metadata } from 'next';
import { notFound } from 'next/navigation';

export const metadata: Metadata = {
title: 'Not found',
};

export default function NotFoundCatchAll() {
notFound();
}
5 changes: 5 additions & 0 deletions app/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ import {
ShopifyFeaturedCollectionOperation,
ShopifyFeaturedProductOperation,
} from '@/lib/shopify/types';
import { Metadata } from 'next';
import { useEffect, useRef, useState } from 'react';

export const metadata: Metadata = {
title: 'Error',
};

export default function Error({
error,
reset,
Expand Down
9 changes: 6 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ import { getLayoutData } from '@/lib/shopify';
import Footer from './compoents/Footer';
import Header from './compoents/Header';
import { cookies } from 'next/headers';
import { Metadata } from 'next';

const inter = Inter({ subsets: ['latin'] });

export const metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
export const metadata: Metadata = {
title: 'This Dot Demo Store',
description:
'The best place to buy snowboarding products offered by This Dot',
viewport: { width: 'device-width', initialScale: 1 },
};

export default async function RootLayout({
Expand Down
12 changes: 6 additions & 6 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import {
getTertiaryHero,
} from '@/lib/shopify';
import Head from 'next/head';
import { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Home | This Dot Demo Store',
robots: 'index, follow',
};

export default async function Homepage() {
const seoStructuredData = {
Expand All @@ -26,12 +32,6 @@ export default async function Homepage() {
return (
<>
<Head>
<title>Home | This Dot Demo Store</title>
<meta
name="description"
content="The best place to buy snowboarding products offered by This Dot"
/>
<meta name="robots" content="index, follow" />
<script type="application/ld+json">
{JSON.stringify(seoStructuredData)}
</script>
Expand Down

0 comments on commit 062f420

Please sign in to comment.