1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-01-09 13:18:54 +01:00

add date to rake task for new posts

This commit is contained in:
Matthias Kretschmann 2015-08-02 21:58:40 +02:00
parent 413f86856d
commit e3c628aa17

View File

@ -17,7 +17,14 @@ task :post do
puts "Dude, file exists - skipping create"
else
File.open(path, "w") do |file|
file.puts YAML.dump({'layout' => 'post', 'published' => false, 'title' => title, 'author' => 'Matthias Kretschmann'})
file.puts YAML.dump({
'layout' => 'post',
'published' => false,
'title' => title,
'image' => 'REPLACEME.jpg',
'author' => 'Matthias Kretschmann',
'date' => Time.now
})
file.puts "---"
end
end
@ -41,7 +48,15 @@ task :photo do
puts "Dude, file exists - skipping create"
else
File.open(path, "w") do |file|
file.puts YAML.dump({'layout' => 'photo', 'published' => false, 'title' => title, 'image' => 'REPLACEME.jpg', 'author' => 'Matthias Kretschmann', 'category' => 'photos'})
file.puts YAML.dump({
'layout' => 'photo',
'published' => false,
'title' => title,
'image' => 'REPLACEME.jpg',
'author' => 'Matthias Kretschmann',
'date' => Time.now,
'category' => 'photos'
})
file.puts "---"
end
end
@ -65,7 +80,13 @@ task :photo do
puts "Dude, file exists - skipping create"
else
File.open(path, "w") do |file|
file.puts YAML.dump({'layout' => 'link', 'published' => false, 'title' => title, 'author' => 'Matthias Kretschmann'})
file.puts YAML.dump({
'layout' => 'link',
'published' => false,
'title' => title,
'author' => 'Matthias Kretschmann',
'date' => Time.now
})
file.puts "---"
end
end