Skip to content

Commit

Permalink
/
Browse files Browse the repository at this point in the history
  • Loading branch information
Jess Portnoy committed Feb 1, 2017
1 parent d81f914 commit 55b1a00
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Rakefile
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

0 comments on commit 55b1a00

Please sign in to comment.