projects
/
blog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
be5c903
)
Fixup post action and template
author
Joerg Jaspert
<joerg@debian.org>
Sun, 6 Mar 2016 21:55:03 +0000
(22:55 +0100)
committer
Joerg Jaspert
<joerg@debian.org>
Sun, 6 Mar 2016 21:55:03 +0000
(22:55 +0100)
Rakefile
patch
|
blob
|
history
_layouts/_post.txt
patch
|
blob
|
history
diff --git
a/Rakefile
b/Rakefile
index
532687c
..
ab563e2
100644
(file)
--- a/
Rakefile
+++ b/
Rakefile
@@
-51,7
+51,7
@@
end
# Save the file with the title in the YAML front matter
def write_file(content, title, directory, filename)
parsed_content = "#{content.sub("title:", "title: \"#{title}\"")}"
# Save the file with the title in the YAML front matter
def write_file(content, title, directory, filename)
parsed_content = "#{content.sub("title:", "title: \"#{title}\"")}"
- parsed_content = "#{parsed_content.sub("date:", "date:
#{POST_TIME}
")}"
+ parsed_content = "#{parsed_content.sub("date:", "date:
'#{POST_TIME}'
")}"
File.write("#{directory}/#{filename}", parsed_content)
puts "#{filename} was created in '#{directory}'."
end
File.write("#{directory}/#{filename}", parsed_content)
puts "#{filename} was created in '#{directory}'."
end
@@
-90,10
+90,10
@@
task :post, [:title] do |t, args|
template = CONFIG["post"]["template"]
extension = CONFIG["post"]["extension"]
editor = CONFIG["editor"]
template = CONFIG["post"]["template"]
extension = CONFIG["post"]["extension"]
editor = CONFIG["editor"]
- check_title(
:
title)
- filename = "#{DATE}-#{transform_to_slug(
:
title, extension)}"
+ check_title(
args.
title)
+ filename = "#{DATE}-#{transform_to_slug(
args.
title, extension)}"
content = read_file(template)
content = read_file(template)
- create_file(POSTS, filename, content,
:
title, editor)
+ create_file(POSTS, filename, content,
args.
title, editor)
end
# rake draft["Title"]
end
# rake draft["Title"]
diff --git
a/_layouts/_post.txt
b/_layouts/_post.txt
index
c2a1143
..
7dc4ddb
100644
(file)
--- a/
_layouts/_post.txt
+++ b/
_layouts/_post.txt
@@
-1,9
+1,9
@@
---
---
+layout: post
title:
subtitle:
description:
image:
title:
subtitle:
description:
image:
-layout: post
permalink:
published: false
categories:
permalink:
published: false
categories: