【发布时间】:2013-07-31 08:54:36
【问题描述】:
我的博客中有以下帖子:
src/documents/posts/foo.html.md
---
category: cooking
---
src/documents/posts/bar.html.md
---
category: programmation
---
我想生成以下路线:
http://example.org/cooking/
http://example.org/programmation/
每条路线都有一个集合,其中仅包含所选类别中的帖子。帖子仍将在标准位置:
http://example.org/posts/foo.html
http://example.org/posts/bar.html
加分:我还希望能够在我的布局中列出类别。类似的东西:
<% for cat in @getCategories() %>
<a href="<%= cat.route %>"><%= cat.name %></a>
<% endfor %>
是否已经存在提供这些功能的插件?如果没有,开始实施它的最佳方式是什么?
我在this answer 中看到了setFilter 方法,但是在解析每个帖子以获取类别后,我仍在努力寻找如何生成新页面。
如果无法实现动态页面生成(我可以理解,因为它需要按特定顺序解析页面),在配置中使用静态数组是否会更容易?
【问题讨论】:
标签: docpad