组织大量文章

随着内容越来越多,需要好好组织。FlowPage 提供了简单有效的方法。

用年月文件夹分类

FlowPage 默认按时间组织内容:

content/pages/
  └── 2025/
      ├── 09/
      │   ├── article-one/
      │   └── article-two/
      └── 10/
          ├── article-three/
          └── article-four/

好处

建议

用分类和标签组织

除了文件夹,用 frontmatter 分类:

---
category: "tutorial"     # 大分类
tags: ["beginner", "quick-start"]  # 细分标签
topics: ["getting-started"]  # 主题
---

这样可以:

设置草稿模式

还没写完的文章设为草稿:

---
draft: true
---

草稿文章

适用场景

批量添加文章

有很多文章要添加?按这个流程:

1. 准备文件夹结构

mkdir -p content/pages/2025/10/{article-1,article-2,article-3}

2. 创建模板文件

准备一个 template.mdx

---
title: ""
description: ""
date: "2025-10-XX"
author: "yourname"
topics: []
tags: []
category: ""
draft: false
---

# Title

## Section 1

Content...

3. 复制到每个文件夹

cp template.mdx content/pages/2025/10/article-1/index.mdx
cp template.mdx content/pages/2025/10/article-2/index.mdx

4. 逐个填写内容

用编辑器打开,填写标题、内容。

查看所有文章

想看所有文章列表?访问导航页(右滑)。

导航页配置在 flowpage.config.ts

content: {
  nav: {
    blocks: [
      {
        title: '最新文章',
        filter: { limit: 10, sortBy: 'date' }
      },
      {
        title: '教程',
        filter: { category: 'tutorial' }
      },
      {
        title: '设计',
        filter: { category: 'design' }
      }
    ]
  }
}

可以按分类、标签、作者筛选。

归档旧文章

旧文章不想删除,但也不想显示在首页?

方法一:用 frontmatter 过滤

在配置里限制日期:

filter: {
  dateAfter: '2025-01-01'  // 只显示这个日期后的
}

方法二:改成草稿

draft: true

文章还在,但不会显示。

文章数量限制

FlowPage 能处理多少文章?

如果超过 10000 篇,建议分站点。

小技巧

内容越多,越需要好的组织方式!