repo_description: 使用 NextJS + Notion API 实现的，支持多种部署方案的静态博客，无需服务器、零门槛搭建网站，为Notion和所有创作者设计。 (A static blog built with NextJS and Notion API, supporting multiple deployment options. No server required, zero threshold to set up a website. Designed for Notion and all creators.)
repo_topics: blog nextjs notion react tailwindcss vercel zeabur
code: 
  // lib/build/staticPaths.js
  import { fetchGlobalAllData } from '@/lib/db/notion'
  import { prefetchAllBlockMaps } from '@/lib/build/prefetch'
  import { isExport } from '../utils/buildMode'
  
  let _prefetchDone = false // 模块级标记，同一构建进程只预热一次
  
  export async function getStaticPathsBase(filterFn) {
    if (!isExport()) {
      return { paths: [], fallback: 'blocking' }
    }
  
    const { allPages } = await fetchGlobalAllData({ from: 'static-paths' })
  
    // 只在第一个调用的路由文件里执行预热
    if (!_prefetchDone) {
      _prefetchDone = true
      // 预热全部，但优先处理最新5篇
      await prefetchAllBlockMaps(allPages)
    }
  
    return {
      paths: allPages.filter(filterFn).map(pageToParams),
      fallback: false
    }
  }
  
  // 把最新5篇单独导出，供各路由文件复用
  export async function getLatestSlugs(allPages, count = 5) {
    return [...allPages]
      .filter(p => p.type === 'Post' && p.status === 'Published')
      .sort((a, b) => new Date(b.publishDate) - new Date(a.publishDate))
      .slice(0, count)
  }
  
  // 把最新5篇单独导出，供各路由文件复用
  export async function getLatestSlugs(allPages, count = 5) {
    return [...allPages]
      .filter(p => p.type === 'Post' && p.status === 'Published')
      .sort((a, b) => new Date(b.publishDate) - new Date(a.publishDate))
      .slice(0, count)
  }