import { getAllCategories, getAllPosts, getAllTags } from '@/lib/notion' import BLOG from '@/blog.config' import BaseLayout from '@/layouts/BaseLayout' import TagItem from '@/components/TagItem' export default function Tag ({ tags, posts, categories }) { const meta = { title: `${BLOG.title} | 标签`, description: BLOG.description, type: 'website' } return
所有标签:
{ tags.map(tag => { return
}) }
} export async function getStaticProps () { let posts = await getAllPosts({ from: 'tag-props' }) posts = posts.filter( post => post.status[0] === 'Published' && post.type[0] === 'Post' ) const tags = await getAllTags(posts, 0) const categories = await getAllCategories(posts) return { props: { tags, posts, categories }, revalidate: 1 } }