mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-05 07:26:46 +00:00
fix date
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import { getGlobalData } from '@/lib/notion/getNotionData'
|
||||
import React from 'react'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import BLOG from '@/blog.config'
|
||||
@@ -34,7 +34,7 @@ export default function Category(props) {
|
||||
|
||||
export async function getStaticProps({ params: { category } }) {
|
||||
const from = 'category-props'
|
||||
let props = await getGlobalNotionData({ from })
|
||||
let props = await getGlobalData({ from })
|
||||
|
||||
// 过滤状态
|
||||
props.posts = props.allPages.filter(page => page.type === 'Post' && page.status === 'Published')
|
||||
@@ -61,7 +61,7 @@ export async function getStaticProps({ params: { category } }) {
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const from = 'category-paths'
|
||||
const { categoryOptions } = await getGlobalNotionData({ from })
|
||||
const { categoryOptions } = await getGlobalData({ from })
|
||||
return {
|
||||
paths: Object.keys(categoryOptions).map(category => ({
|
||||
params: { category: categoryOptions[category]?.name }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import { getGlobalData } from '@/lib/notion/getNotionData'
|
||||
import React from 'react'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import BLOG from '@/blog.config'
|
||||
@@ -34,7 +34,7 @@ export default function Category(props) {
|
||||
|
||||
export async function getStaticProps({ params: { category, page } }) {
|
||||
const from = 'category-page-props'
|
||||
let props = await getGlobalNotionData({ from })
|
||||
let props = await getGlobalData({ from })
|
||||
|
||||
// 过滤状态类型
|
||||
props.posts = props.allPages.filter(page => page.type === 'Post' && page.status === 'Published').filter(post => post && post.category && post.category.includes(category))
|
||||
@@ -56,7 +56,7 @@ export async function getStaticProps({ params: { category, page } }) {
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const from = 'category-paths'
|
||||
const { categoryOptions, allPages } = await getGlobalNotionData({ from })
|
||||
const { categoryOptions, allPages } = await getGlobalData({ from })
|
||||
const paths = []
|
||||
|
||||
categoryOptions?.forEach(category => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import { getGlobalData } from '@/lib/notion/getNotionData'
|
||||
import React from 'react'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import BLOG from '@/blog.config'
|
||||
@@ -30,7 +30,7 @@ export default function Category(props) {
|
||||
}
|
||||
|
||||
export async function getStaticProps() {
|
||||
const props = await getGlobalNotionData({ from: 'category-index-props' })
|
||||
const props = await getGlobalData({ from: 'category-index-props' })
|
||||
delete props.allPages
|
||||
return {
|
||||
props,
|
||||
|
||||
Reference in New Issue
Block a user