File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1+ import type { Metadata } from 'next' ;
12import Link from 'next/link' ;
23
4+ export const metadata : Metadata = {
5+ title : '关于' ,
6+ } ;
7+
38export default function About ( ) {
49 return (
510 < div className = "mx-auto max-w-screen-lg px-8 py-10" >
Original file line number Diff line number Diff line change 1+ import type { Metadata } from 'next' ;
2+
13import BackLink from '@/components/back-link' ;
24import TypeAnimation from '@/components/type-animation' ;
35
6+ export const metadata : Metadata = {
7+ title : '404' ,
8+ } ;
9+
410export default function NotFound ( ) {
511 return (
612 < div className = "mx-auto max-w-screen-lg px-8 py-10" >
Original file line number Diff line number Diff line change 1+ import { notFound } from 'next/navigation' ;
12import { format } from 'date-fns' ;
23
34import Markdown from '@/components/markdown' ;
5+ import BackLink from '@/components/back-link' ;
46import { readingTime } from '@/lib/utils' ;
57import client from '@/tina/__generated__/client' ;
6- import BackLink from '@/components/back-link' ;
78
89export const revalidate = 3600 ; // invalidate every hour
910
@@ -40,7 +41,13 @@ export default async function Post({
4041 params : Promise < { slug : string } > ;
4142} ) {
4243 const { slug } = await params ;
43- const { data } = await client . queries . post ( { relativePath : `${ slug } .mdx` } ) ;
44+ const { data, errors } = await client . queries . post ( {
45+ relativePath : `${ slug } .mdx` ,
46+ } ) ;
47+
48+ if ( errors ) {
49+ return notFound ( ) ;
50+ }
4451
4552 return (
4653 < div className = "mx-auto max-w-screen-lg px-8 py-10" >
You can’t perform that action at this time.
0 commit comments