diff --git a/app/constants/SEOConfig.ts b/app/constants/SEOConfig.ts index 3a43048..2e087ec 100644 --- a/app/constants/SEOConfig.ts +++ b/app/constants/SEOConfig.ts @@ -10,10 +10,7 @@ export const SEOConfig: Metadata = { referrer: 'origin-when-cross-origin', creator: myInfo.name, publisher: myInfo.name, - authors: [ - { name: myInfo.nickname }, - // TODO - { url: 'https://junseokku.dev' }, - ], + authors: [{ name: myInfo.nickname }, { url: myInfo.blog.url }], twitter: { title: myInfo.blog.name, description: myInfo.description, diff --git a/app/posts/[slug]/page.tsx b/app/posts/[slug]/page.tsx index 8dfcd90..ee248d1 100644 --- a/app/posts/[slug]/page.tsx +++ b/app/posts/[slug]/page.tsx @@ -50,6 +50,7 @@ export async function generateMetadata({ params }: Params): Promise { title, description, alternates: { canonical: url }, + keywords: targetPost.tags, openGraph: { url, title, diff --git a/app/sitemap.ts b/app/sitemap.ts new file mode 100644 index 0000000..5ff69aa --- /dev/null +++ b/app/sitemap.ts @@ -0,0 +1,32 @@ +import { MetadataRoute } from 'next'; +import { myInfo } from './constants/myInfo'; +import { allPosts } from 'contentlayer/generated'; + +export default function sitemap(): MetadataRoute.Sitemap { + const sitemapPosts = generateSitemapPosts(); + + return [ + { + url: `${myInfo.blog.url}`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 1, + }, + { + url: `${myInfo.blog.url}/posts`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 0.8, + }, + ...sitemapPosts, + ]; +} + +const generateSitemapPosts = (): MetadataRoute.Sitemap => { + return allPosts.map((post) => ({ + url: `${myInfo.blog.url}/${post._raw.flattenedPath}`, + lastModified: new Date(post.updatedAt ?? post.createdAt), + changeFrequency: 'daily', + priority: 0.8, + })); +}; diff --git a/contentlayer.config.ts b/contentlayer.config.ts index b29e3a3..064ca3f 100644 --- a/contentlayer.config.ts +++ b/contentlayer.config.ts @@ -18,7 +18,7 @@ export const Post = defineDocumentType(() => ({ author: { type: 'string', required: true }, tags: { type: 'list', of: { type: 'string' }, required: true }, categories: { type: 'list', of: { type: 'string' }, required: true }, - summary: { type: 'string', required: false }, + summary: { type: 'string', required: true }, }, computedFields: { url: { diff --git a/posts/2024-05-25-nextjs-typedRoutes.mdx b/posts/nextjs-typed-routes/index.mdx similarity index 97% rename from posts/2024-05-25-nextjs-typedRoutes.mdx rename to posts/nextjs-typed-routes/index.mdx index 911a8e0..34a5283 100644 --- a/posts/2024-05-25-nextjs-typedRoutes.mdx +++ b/posts/nextjs-typed-routes/index.mdx @@ -1,10 +1,10 @@ --- title: '[번역] 타입 안전성 있게 Next.js에서 라우팅 하기' createdAt: 2024-05-25 -author: Junseokku +author: junseokku tags: [translate, app-router, typed-safety, routing, 타입, 안정성, 라우팅] categories: [] -summary: '' +summary: 'Next,js Link(href, as), useRouter(.push(url, as))을 사용하는 등 라우팅 상황에서 런타임 검증과 타입 안정성 있게 라우팅하는 방법을 소개한다.' --- > 원글: [https://www.flightcontrol.dev/blog/fix-nextjs-routing-to-have-full-type-safety](https://www.flightcontrol.dev/blog/fix-nextjs-routing-to-have-full-type-safety) diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..aecf477 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,9 @@ +# * +User-agent: * +Allow: / + +# Host +Host: https://junseokku.dev + +# Sitemaps +Sitemap: https://junseokku.dev/sitemap.xml \ No newline at end of file