Skip to content

Commit

Permalink
add redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
qq8244353 committed Nov 23, 2023
1 parent 37c4144 commit b727989
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,34 @@ export default function IndexPage({
)
}

// export const getStaticProps: GetStaticProps<Props> = async () => {
// const { meta: aboutMeta } = getPageMarkdown<AboutMeta>('about')
// const { meta: scheduleMeta } = getPageMarkdown<ScheduleMeta>('schedule')
// const { meta: contactMeta } = getPageMarkdown<ContactMeta>('contact')
// const articles = getArticlesAll()
//
// return {
// props: {
// aboutData: {
// meta: aboutMeta,
// },
// scheduleData: {
// meta: scheduleMeta,
// },
// contactData: {
// meta: contactMeta,
// },
// newsData: {
// articlesStr: JSON.stringify(articles),
// },
// },
// }
// }
export const getStaticProps: GetStaticProps<Props> = async () => {
const { meta: aboutMeta } = getPageMarkdown<AboutMeta>('about')
const { meta: scheduleMeta } = getPageMarkdown<ScheduleMeta>('schedule')
const { meta: contactMeta } = getPageMarkdown<ContactMeta>('contact')
const articles = getArticlesAll()

return {
props: {
aboutData: {
meta: aboutMeta,
},
scheduleData: {
meta: scheduleMeta,
},
contactData: {
meta: contactMeta,
},
newsData: {
articlesStr: JSON.stringify(articles),
},
},
redirect: {
permanent: false,
destination: '/ridaisai/2023',
}
}
}

0 comments on commit b727989

Please sign in to comment.