forked from kaltura/developer-platform-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
33 lines (25 loc) · 812 Bytes
/
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
TPL = "_site/menu.html"
TST = "_includes/menu.html"
task :default => :nav
desc "Generates sidebar then copy it to be used as an include"
task :nav do
#if !File.exist?(TST)
# puts "Creating dummy #{TST} file"
# open(TST, 'w') do |f|
# f.puts warning
# end
#end
# alas, there is no way to generate only a single file using Jekyll, so, we do the first iteration for the benefit of generating an up to date menu.html and then again so that all files get the updated include
puts "Building Jekyll "
system "jekyll build --trace"
# delete target file (TST) if exist
if File.exist?(TST)
puts "#{TST} exists deleting it"
rm TST
end
# copy generated file as an include
cp(TPL, TST)
puts "Building Jekyll AGAIN"
system "jekyll build --trace"
puts "task END"
end