-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
58 lines (51 loc) · 1.81 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
task :notify => ["notify:pingomatic", "notify:google", "notify:bing"]
desc "Notify various services that the site has been updated"
namespace :notify do
desc "Notify Ping-O-Matic"
task :pingomatic do
begin
require "xmlrpc/client"
puts "* Notifying Ping-O-Matic that the site has updated"
XMLRPC::Client.new("rpc.pingomatic.com", "/").call("weblogUpdates.extendedPing", "neontapir.github.io", "//neontapir.github.io", "//neontapir.github.io/atom.xml", "//neontapir.github.io/feed.xml")
rescue LoadError
puts "! Could not ping ping-o-matic, because XMLRPC::Client could not be found."
end
end
desc "Notify Google of updated sitemap"
task :google do
begin
require "net/http"
require "uri"
puts "* Notifying Google that the site has updated"
Net::HTTP.get("www.google.com", "/webmasters/tools/ping?sitemap=" + URI.escape("//neontapir.github.io/sitemap.xml"))
rescue LoadError
puts "! Could not ping Google about our sitemap, because Net::HTTP or URI could not be found."
end
end
desc "Notify Bing of updated sitemap"
task :bing do
begin
require "net/http"
require "uri"
puts "* Notifying Bing that the site has updated"
Net::HTTP.get("www.bing.com", "/webmaster/ping.aspx?siteMap=" + URI.escape("//neontapir.github.io/sitemap.xml"))
rescue LoadError
puts "! Could not ping Bing about our sitemap, because Net::HTTP or URI could not be found."
end
end
end
PORT = 4001
desc "Serve"
task :serve do
sh %Q[bundle exec jekyll serve --port #{PORT} --incremental]
end
desc "Serve without incremental"
task :serve_all do
sh %Q[bundle exec jekyll serve --port #{PORT}]
end
desc "Profile Liquid"
task :profile do
sh %Q[bundle exec jekyll build --profile]
end
desc "Default is to build everything"
task :default => :serve