Use the post's title for the filename rather than its ID, as per Jekyll's naming convention.

This commit is contained in:
Stephen McDonald 2011-11-20 22:09:43 +11:00
parent 06f5b7d2e3
commit 6826317e00
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ module Jekyll
content << CGI::unescapeHTML(post.at("video-caption").inner_html) unless post.at("video-caption") == nil
end # End post types
name = "#{Date.parse(post['date']).to_s}-#{post['id'].downcase.gsub(/[^a-z0-9]/, '-')}.html"
name = "#{Date.parse(post['date']).to_s}-#{title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')}.#{format}"
if title != nil || content != nil && name != nil
File.open("_posts/tumblr/#{name}", "w") do |f|