diff --git a/app/tags/[tag]/page.tsx b/app/tags/[tag]/page.tsx deleted file mode 100644 index 46ca5285..00000000 --- a/app/tags/[tag]/page.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { slug } from 'github-slugger' -import { allCoreContent, sortPosts } from 'pliny/utils/contentlayer' -import siteMetadata from '@/data/siteMetadata' -import ListLayout from '@/layouts/ListLayoutWithTags' -import { allBlogs } from 'contentlayer/generated' -import tagData from 'app/tag-data.json' -import { genPageMetadata } from 'app/seo' -import { Metadata } from 'next' - -export async function generateMetadata({ params }: { params: { tag: string } }): Promise { - const tag = decodeURI(params.tag) - return genPageMetadata({ - title: tag, - description: `${siteMetadata.title} ${tag} tagged content`, - alternates: { - canonical: './', - types: { - 'application/rss+xml': `${siteMetadata.siteUrl}/tags/${tag}/feed.xml`, - }, - }, - }) -} - -export const generateStaticParams = async () => { - const tagCounts = tagData as Record - const tagKeys = Object.keys(tagCounts) - const paths = tagKeys.map((tag) => ({ - tag: tag, - })) - return paths -} - -export default function TagPage({ params }: { params: { tag: string } }) { - const tag = decodeURI(params.tag) - // Capitalize first letter and convert space to dash - const title = tag[0].toUpperCase() + tag.split(' ').join('-').slice(1) - const filteredPosts = allCoreContent( - sortPosts(allBlogs.filter((post) => post.tags && post.tags.map((t) => slug(t)).includes(tag))) - ) - return -} diff --git a/app/tags/page.tsx b/app/tags/page.tsx deleted file mode 100644 index 5b7a83c2..00000000 --- a/app/tags/page.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import Link from '@/components/Link' -import Tag from '@/components/Tag' -import { slug } from 'github-slugger' -import tagData from 'app/tag-data.json' -import { genPageMetadata } from 'app/seo' - -export const metadata = genPageMetadata({ title: 'Tags', description: 'Things I blog about' }) - -export default async function Page() { - const tagCounts = tagData as Record - const tagKeys = Object.keys(tagCounts) - const sortedTags = tagKeys.sort((a, b) => tagCounts[b] - tagCounts[a]) - return ( - <> -
-
-

- Tags -

-
-
- {tagKeys.length === 0 && 'No tags found.'} - {sortedTags.map((t) => { - return ( -
- - - {` (${tagCounts[t]})`} - -
- ) - })} -
-
- - ) -} diff --git a/package.json b/package.json index 330fb5cd..fd9d9b9b 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "start": "next dev", "dev": "cross-env INIT_CWD=$PWD next dev", - "build": "cross-env INIT_CWD=$PWD next build && cross-env NODE_OPTIONS='--experimental-json-modules' node ./scripts/postbuild.mjs", + "build": "cross-env INIT_CWD=$PWD next build && cross-env NODE_OPTIONS='--experimental-json-modules' node ./scripts/postbuild.mjs && next export", "serve": "next start", "analyze": "cross-env ANALYZE=true next build", "lint": "next lint --fix --dir pages --dir app --dir components --dir lib --dir layouts --dir scripts"