From 55b1a0000af5ae1e6f4f361695828cf722e20275 Mon Sep 17 00:00:00 2001 From: Jess Portnoy Date: Wed, 1 Feb 2017 17:20:27 +0000 Subject: [PATCH] / --- Rakefile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Rakefile diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..25a1d9e4 --- /dev/null +++ b/Rakefile @@ -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 +