-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create app directory and root layout * Upgrade Next.js package * Add nextjs-toploader so route progress works in app dir * Port over icon/manifest metadata into layout * Copy over body styles * Add root providers * Port over the main page layout and refactor pathname * Move over analytics * Migrate styles and use next optimized fonts * Migrate the default seo metadata * Add missing metadataBase option * Convert index page * Convert about page * Move selectors into the page components * Set meta title template * Migrate blog index page * Migrate blog slug page * Migrate blog tags page * Migrate project pages * Remove _app/_document and all redundant packages/components * Refactor sitemap generation * Fix meta content * Clean up * Add back next-seo for JSON-LD support * Update metadata
- Loading branch information
1 parent
aefb816
commit 8b54033
Showing
30 changed files
with
658 additions
and
662 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import type { Metadata, ResolvingMetadata } from 'next'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
import { getBlogPost, getBlogPosts } from '~/content/blog/client'; | ||
|
||
import { siteMetadata } from '~/config/metadata'; | ||
|
||
import { BlogPostPage } from './BlogPostPage'; | ||
|
||
interface Props { | ||
params: { slug: string }; | ||
} | ||
|
||
export async function generateMetadata( | ||
{ params }: Props, | ||
parent: ResolvingMetadata | ||
): Promise<Metadata | undefined> { | ||
const post = getBlogPost(params.slug); | ||
|
||
if (!post) { | ||
return; | ||
} | ||
|
||
const { title, summary, date, lastModified, tags, slug } = post; | ||
|
||
const parentOpenGraph = (await parent).openGraph || {}; | ||
|
||
const url = `${siteMetadata.siteUrl}/blog/${slug}`; | ||
|
||
return { | ||
title, | ||
description: summary, | ||
alternates: { | ||
canonical: url, | ||
}, | ||
openGraph: { | ||
...parentOpenGraph, | ||
title, | ||
description: summary, | ||
type: 'article', | ||
publishedTime: date, | ||
modifiedTime: lastModified, | ||
url, | ||
tags: tags.map(tag => tag.displayName), | ||
}, | ||
}; | ||
} | ||
|
||
export const dynamicParams = false; | ||
|
||
export function generateStaticParams() { | ||
const posts = getBlogPosts(); | ||
return posts.map(({ slug }) => ({ slug })); | ||
} | ||
|
||
export default function Page({ params }: Props) { | ||
const post = getBlogPost(params.slug); | ||
|
||
if (!post) { | ||
notFound(); | ||
} | ||
|
||
return <BlogPostPage post={post} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
8b54033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
melanies-dev – ./
melanies-dev-melanieseltzer.vercel.app
melanies-dev-git-main-melanieseltzer.vercel.app
melanies.dev
melanies-dev.vercel.app
www.melanies.dev