ennova / postmarkdown

A simple Rails blog engine powered by Markdown.
http://rubygems.org/gems/postmarkdown
79 stars 19 forks source link

Adding time to generated post file name. #10

Closed nowaterlili closed 11 years ago

nowaterlili commented 11 years ago

Posts are now be generated with a UTC time included in their filename to allow for correct time identification and also proper sorting when multiple posts exist on the same day.

The generator can be run as follows:

rails g postmarkdown:post new-post # will generate the file app/posts/{year}-{month}-{day}-{hour}{minute}{second}-new-post.markdown
rails g postmarkdown:post new-post --date=2012-12-18 # will generate the file app/posts/2012-12-18-000000-new-post.markdown
rails g postmarkdown:post new-post --date=2012-12-18-203231 # will generate the file app/posts/2012-12-18-203231-new-post.markdown

Also, I had to include some additional dependencies to be able to test the PostGenerator.

Generated posts with a filename of {year}-{month}-{day}-name.markdown (from previous postmarkdown versions) are equivalent to {year}-{month}-{day}-000000-name.markdown

jasoncodes commented 11 years ago

Thanks for your pull request. This is a great addition to Postmarkdown.

This feature is now available in 0.0.5.