【发布时间】:2016-03-14 00:07:12
【问题描述】:
我有一个 Middleman 博客,其中包含源/期刊中的帖子文件。
我的博客配置:
activate :blog do |blog|
# set options on blog
blog.prefix = "journal"
blog.permalink = "{year}-{month}-{day}-{title}.html.haml"
blog.sources = "{title}.html.haml"
blog.layout = "journal_layout"
end
还有一个位于 source/journal/2015-12-02-hello-world.html.haml 的帖子文件
\---
title: Hello World
date: 2015-12-02
category: Photography
\---
%article
%h1 Hello World
%p Denver, Colorado :: December 2nd, 2015
%p Lore ipsum dolar
我可以使用直接网址打开页面,但帖子没有注册:
- blog.articles[0...5].each do |article|
%article
%h2= link_to article.title, article.url
...frontmatter 只是在页面顶部显示为纯文本。
非常感谢您的宝贵时间。
更新!
博客配置应该是:
activate :blog do |blog|
# set options on blog
blog.prefix = "journal"
blog.permalink = "{year}-{month}-{day}-{title}.html"
blog.sources = "{year}-{month}-{day}-{title}.html.haml"
blog.layout = "journal_layout"
end
以及文章HAML文件:
---
title: Hello World
date: 2015-12-02
category: Photography
---
%article
%h1 Hello World
%p Denver, Colorado :: December 2nd, 2015
%p Lore ipsum dolar
【问题讨论】: