Skip to content

Instantly share code, notes, and snippets.

@scottjad
Created September 27, 2011 06:59
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save scottjad/1244494 to your computer and use it in GitHub Desktop.
Octopress Rakefile changes to support org-mode
@@ -20,9 +20,10 @@ blog_index_dir = 'source' # directory for your blog's index pa
deploy_dir = "_deploy" # deploy directory (for Github pages deployment)
stash_dir = "_stash" # directory to stash posts for speedy generation
posts_dir = "_posts" # directory for blog files
+org_posts_dir = "org_posts"
themes_dir = ".themes" # directory for blog files
-new_post_ext = "markdown" # default new post file extension when using the new_p
-new_page_ext = "markdown" # default new page file extension when using the new_p
+new_post_ext = "org" # default new post file extension when using the new_post t
+new_page_ext = "org" # default new page file extension when using the new_page t
server_port = "4000" # port for preview server eg. localhost:4000
@@ -99,13 +100,14 @@ task :new_post, :title do |t, args|
puts "Creating new post: #{filename}"
open(filename, 'w') do |post|
system "mkdir -p #{source_dir}/#{posts_dir}/";
+ post.puts "#+BEGIN_HTML"
post.puts "---"
post.puts "layout: post"
post.puts "title: \"#{title.gsub(/&/,'&').titlecase}\""
post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
post.puts "comments: true"
post.puts "categories: "
- post.puts "---"
+ post.puts "#+END_HTML"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment