Skip to content

Instantly share code, notes, and snippets.

@CarterA
Created October 2, 2011 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CarterA/1257930 to your computer and use it in GitHub Desktop.
Save CarterA/1257930 to your computer and use it in GitHub Desktop.
About This Website
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
behavior: url(/stylesheets/PIE.htc);
box-shadow: inset 0 0 8px black;
-moz-box-shadow: inset 0 0 8px black;
-webkit-box-shadow: inset 0 0 8px black;
task :default => :server
desc 'Build site with Jekyll.'
task :build do
jekyll
end
desc 'Start server with --auto.'
task :server do
jekyll('--server --auto')
end
desc 'Remove all built files.'
task :clean do
sh 'rm -rf _site'
end
def jekyll(opts = '')
Rake::Task['clean'].execute
sh 'jekyll ' + opts
end
desc 'Build, deploy, then clean.'
task :deploy => :build do
sh 'rsync -rtzh --progress _site/ carterallen@cartera.me:~/cartera.me/'
Rake::Task['clean'].execute
end
task :new do
title = ask("# ") #
fileName = ask("Filename: ")
article = {"title" => title, "layout" => "post"}.to_yaml
article << "---"
path = "_posts/#{Time.now.strftime("%Y-%m-%d")}#{'-' + fileName}.md"
unless File.exist?(path)
File.open(path, "w") do |file|
file.write article
sh "mate " + path
end
puts "A new article was created at #{path}."
else
puts "There was an error creating the article, #{path} already exists."
end
end
def ask message
print message
STDIN.gets.chomp
end
<script src="/scripts/modernizr-1.5.min.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment