forked from meltingice/CamanJS-Site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
76 lines (57 loc) · 1.67 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
namespace :jekyll do
desc 'Delete generated _site files'
task :clean do
system "rm -fR _site"
end
desc 'Run the jekyll dev server'
task :server do
system "jekyll --server --auto"
end
desc 'Clean temporary files and run the server'
task :compile => [:clean, 'compass:clean', 'compass:compile'] do
system "jekyll"
end
end
namespace :deploy do
desc 'Deploy to production'
task :prod => ['dev:off'] do
system "cap deploy"
end
end
namespace :compass do
desc 'Delete temporary compass files'
task :clean do
system "rm -fR css/*"
end
desc 'Run the compass watch script'
task :watch do
system "compass watch"
end
desc 'Compile sass scripts'
task :compile => [:clean] do
system "compass compile"
end
end
namespace :pygments do
desc 'Delete pygments CSS files'
task :clean do
system "rm -f _sass/3rd_party/pygments/*.scss"
end
desc 'Generate pygments CSS'
task :compile => [:clean] do
system "mkdir -p _sass/3rd_party/pygments"
system "pygmentize -S default -f html > _sass/3rd_party/pygments/default.scss"
end
end
namespace :dev do
desc 'Un-publish old posts to speed up development'
task :on => ['jekyll:clean'] do
system 'find . -name "*.textile" -exec sed -i "" "s|^published: true|published: false|g" {} \;'
system 'find . -name "*.yml" -exec sed -i "" "s|^published: true|published: false|g" {} \;'
end
desc 'Re-publish old posts for deployment'
task :off => ['jekyll:clean'] do
system 'find . -name "*.textile" -exec sed -i "" "s|^published: false|published: true|g" {} \;'
system 'find . -name "*.yml" -exec sed -i "" "s|^published: false|published: true|g" {} \;'
end
end