mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-07 07:26:46 +00:00
fix date
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import { getGlobalData } from '@/lib/notion/getNotionData'
|
||||
import BLOG from '@/blog.config'
|
||||
import { useRouter } from 'next/router'
|
||||
import { getLayoutByTheme } from '@/themes/theme'
|
||||
@@ -30,7 +30,7 @@ const Tag = props => {
|
||||
|
||||
export async function getStaticProps({ params: { tag } }) {
|
||||
const from = 'tag-props'
|
||||
const props = await getGlobalNotionData({ from })
|
||||
const props = await getGlobalData({ from })
|
||||
|
||||
// 过滤状态
|
||||
props.posts = props.allPages.filter(page => page.type === 'Post' && page.status === 'Published').filter(post => post && post.tags && post.tags.includes(tag))
|
||||
@@ -68,7 +68,7 @@ function getTagNames(tags) {
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const from = 'tag-static-path'
|
||||
const { tagOptions } = await getGlobalNotionData({ from })
|
||||
const { tagOptions } = await getGlobalData({ from })
|
||||
const tagNames = getTagNames(tagOptions)
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import { getGlobalData } from '@/lib/notion/getNotionData'
|
||||
import BLOG from '@/blog.config'
|
||||
import { useRouter } from 'next/router'
|
||||
import { getLayoutByTheme } from '@/themes/theme'
|
||||
@@ -25,7 +25,7 @@ const Tag = props => {
|
||||
|
||||
export async function getStaticProps({ params: { tag, page } }) {
|
||||
const from = 'tag-page-props'
|
||||
const props = await getGlobalNotionData({ from })
|
||||
const props = await getGlobalData({ from })
|
||||
// 过滤状态、标签
|
||||
props.posts = props.allPages.filter(page => page.type === 'Post' && page.status === 'Published').filter(post => post && post.tags && post.tags.includes(tag))
|
||||
// 处理文章数
|
||||
@@ -44,7 +44,7 @@ export async function getStaticProps({ params: { tag, page } }) {
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const from = 'tag-page-static-path'
|
||||
const { tagOptions, allPages } = await getGlobalNotionData({ from })
|
||||
const { tagOptions, allPages } = await getGlobalData({ from })
|
||||
const paths = []
|
||||
tagOptions?.forEach(tag => {
|
||||
// 过滤状态类型
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
||||
import { getGlobalData } from '@/lib/notion/getNotionData'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import BLOG from '@/blog.config'
|
||||
import { useRouter } from 'next/router'
|
||||
@@ -30,7 +30,7 @@ const TagIndex = props => {
|
||||
|
||||
export async function getStaticProps() {
|
||||
const from = 'tag-index-props'
|
||||
const props = await getGlobalNotionData({ from })
|
||||
const props = await getGlobalData({ from })
|
||||
delete props.allPages
|
||||
return {
|
||||
props,
|
||||
|
||||
Reference in New Issue
Block a user