-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jess Portnoy
committed
Feb 1, 2017
1 parent
d81f914
commit 55b1a00
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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 | ||
|