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
import { GetStaticProps, GetStaticPaths } from "next"; | |
import Loading from "../../components/loading"; | |
import dayjs from 'dayjs'; | |
type Props = { | |
id: string; | |
buildAt: string; | |
}; | |
export const getStaticProps: GetStaticProps<Props> = async (context) => { | |
return { | |
props: { | |
id: context.params.id as string, | |
buildAt: dayjs().format('YYYY年MM月DD日 HH:mm:ss'), | |
}, | |
unstable_revalidate: 10000, | |
}; | |
}; | |
export const getStaticPaths: GetStaticPaths = async () => { | |
return { | |
paths: ["/mag/1"], | |
fallback: true, | |
}; | |
}; | |
export default (props: Props) => { | |
return ( | |
<> | |
<p>{props.id}: Build At {props.buildAt}</p> | |
<p>version: 4</p> | |
<Loading /> | |
</> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment