Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qq8244353 committed Nov 23, 2023
1 parent 9db1247 commit 8f17514
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// import { getArticlesAll, getPageMarkdown } from 'api/markdowns'
import { getArticlesAll, getPageMarkdown } from 'api/markdowns'
import { GetStaticProps } from 'next'
import Home from 'src/pages/Home'
import { EventCalendar } from 'src/pages/Home/ScheduleView'
Expand Down Expand Up @@ -47,10 +47,6 @@ 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: {
Expand All @@ -70,10 +66,33 @@ export default function IndexPage({
// }
// }
export const getStaticProps: GetStaticProps<Props> = async () => {
return {
redirect: {
permanent: false,
destination: '/ridaisai/2023',
const { meta: aboutMeta } = getPageMarkdown<AboutMeta>('about')
const { meta: scheduleMeta } = getPageMarkdown<ScheduleMeta>('schedule')
const { meta: contactMeta } = getPageMarkdown<ContactMeta>('contact')
const articles = getArticlesAll()
if (Date.now() <= Date.parse('26 Nov 2023 00:09:00 GMT')) {
return {
redirect: {
permanent: false,
destination: '/ridaisai/2023',
}
}
} else {
return {
props: {
aboutData: {
meta: aboutMeta,
},
scheduleData: {
meta: scheduleMeta,
},
contactData: {
meta: contactMeta,
},
newsData: {
articlesStr: JSON.stringify(articles),
},
},
}
}
}

0 comments on commit 8f17514

Please sign in to comment.