Put the following in your config.rb file.
activate :blog do |blog|
blog.permalink = ":year-:month-:day-:title.html"
blog.sources = "blog_articles/:title.html"
end
Assuming you have a post 2012-01-01-example-article.html.markdown
stored in the folder source/blog_articles
.
You should now see the post with this URL: http://localhost:4567/2012-01-01-example-article.html
. (You might have to restart middleman when changing the config.rb
file.)
Please note that I also had to set blog.permalink
, the blog.sources
setting alone didn't do the trick.
A bonus tip: I have activate :directory_indexes
in my config.rb
file. This setting gives you nice looking URLs, without the .html
part.
If you want the same for your blog posts you can drop the .html
from your blog.permalink
setting. Like so:
activate :blog do |blog|
blog.permalink = ":year-:month-:day-:title"
blog.sources = "blog_articles/:title.html"
end
Now you can see your post with this URL: http://localhost:4567/2012-01-01-example-article
.