Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (60 sloc) 2.09 KB
# Usage: rake minify
desc "Minify files"
task :minify do
puts '* Minifying files'
system "java -jar _build/htmlcompressor.jar -r --type html --compress-js -o _site _site"
end # task :minify
# Usage: rake drafts
desc "Build Jekyll site with _drafts posts"
task :drafts do
system "jekyll build --drafts --limit_posts 10"
end # task :drafts
# Ping Pingomatic
desc 'Ping pingomatic'
task :pingomatic do
begin
require 'xmlrpc/client'
puts '* Pinging ping-o-matic'
XMLRPC::Client.new('rpc.pingomatic.com', '/').call('weblogUpdates.extendedPing', 'mademistakes.com' , 'http://mademistakes.com', 'http://mademistakes.com/atom.xml')
rescue LoadError
puts '! Could not ping ping-o-matic, because XMLRPC::Client could not be found.'
end
end
# Ping Google
desc 'Notify Google of the new sitemap'
task :sitemapgoogle do
begin
require 'net/http'
require 'uri'
puts '* Pinging Google about our sitemap'
Net::HTTP.get('www.google.com', '/webmasters/tools/ping?sitemap=' + URI.escape('http://mademistakes.com/sitemap.xml'))
rescue LoadError
puts '! Could not ping Google about our sitemap, because Net::HTTP or URI could not be found.'
end
end
# Ping Bing
desc 'Notify Bing of the new sitemap'
task :sitemapbing do
begin
require 'net/http'
require 'uri'
puts '* Pinging Bing about our sitemap'
Net::HTTP.get('www.bing.com', '/webmaster/ping.aspx?siteMap=' + URI.escape('http://mademistakes.com/sitemap.xml'))
rescue LoadError
puts '! Could not ping Bing about our sitemap, because Net::HTTP or URI could not be found.'
end
end
# rake notify
desc 'Notify various services about new content'
task :notify => [:pingomatic, :sitemapgoogle, :sitemapbing] do
end
# rake rsync
desc 'rsync the contents of ./_site to the server'
task :rsync do
puts '* rsyncing the contents of ./_site to the server'
system 'rsync -prvz --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r _site/ ekoagency.com@s98164.gridserver.com:domains/mademistakes.com/html/'
end
# rake deploy
desc 'Minify files, rsync the files, and notify services about new content'
task :deploy => [:minify, :rsync, :notify] do
end
You can’t perform that action at this time.