From 26b2d122727ec1934161bec094a3d3b910387b7c Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Sun, 26 Apr 2020 15:26:47 +0100 Subject: [PATCH 01/13] initial bash serve and recipe creation - needs polish --- _recipes/template.md | 21 ++++++++++++++ bin/chowdown | 67 ++++++++++++++++++++++++++++++++++++++++++++ bin/serve | 1 + 3 files changed, 89 insertions(+) create mode 100644 _recipes/template.md create mode 100755 bin/chowdown create mode 100755 bin/serve diff --git a/_recipes/template.md b/_recipes/template.md new file mode 100644 index 000000000..8b5d3fa6a --- /dev/null +++ b/_recipes/template.md @@ -0,0 +1,21 @@ +--- +layout: recipe +title: Template Recipe +image: image-name.jpg +# imagecredit: Rue +categories: [snack] +cuisines: [Mediterranean, Irish, British] +diets: [Vegetarian, GlutenFree] +yield: 4 slices +published: true + +ingredients: + - everything + +directions: + - Copy this file to a new name under the **_recipes** folder + - Set all the options you need for your recipe. + - remove the **published false** line from the front matter. + +--- +This is an example recipe which should contain the full gamut of options available. diff --git a/bin/chowdown b/bin/chowdown new file mode 100755 index 000000000..c36b18d40 --- /dev/null +++ b/bin/chowdown @@ -0,0 +1,67 @@ +#!/usr/bin/env ruby + +require 'getoptlong' +require 'pathname' +require 'fileutils' + +opts = GetoptLong.new( + [ '--help', '-h', GetoptLong::NO_ARGUMENT ], + [ '--recipe', '-r', GetoptLong::REQUIRED_ARGUMENT ], + [ '--book', '-b', GetoptLong::OPTIONAL_ARGUMENT ] +) + +def help + puts <<-EOF +chowdown OPTION NAME + +-h, --help: +show help + +--recipe NAME, -r NAME: +create new recipe + +--book NAME: +create new book + +NAME +The name of the page you want to create + EOF +end + +class Recipe + RECIPEPATH = Pathname('_recipes/') + TEMPLATE = 'template.md' + + def initialize(name) + @name = name + end + + def filename + @filename ||= Pathname( + @name.gsub(/[[:space:]]/, '-') + .gsub(/[^[:alnum:]-]/, '') + .downcase + '.md' + ) + end + + def create! + if RECIPEPATH.join(filename).exist? + puts "That recipe already exists" + else + FileUtils.cp(RECIPEPATH.join(TEMPLATE), RECIPEPATH.join(filename)) + puts "Go cook!" + end + end +end + + +opts.each do |opt, arg| + case opt + when '--help' + help() + when '--recipe' + Recipe.new(arg).create! + when '--book' + new_book(arg) + end +end diff --git a/bin/serve b/bin/serve new file mode 100755 index 000000000..52eb4848b --- /dev/null +++ b/bin/serve @@ -0,0 +1 @@ +bundle exec jekyll serve --trace -H 0.0.0.0 -P 8080 From e8322446aa8823cf0630618bc9b7f4bfcd23b4f8 Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Mon, 27 Apr 2020 18:31:17 +0100 Subject: [PATCH 02/13] polish up Now functioning --- _recipes/template.md | 21 ------------- bin/chowdown | 72 +++++++++++++++++++++++++++++--------------- bin/recipe.template | 29 ++++++++++++++++++ 3 files changed, 76 insertions(+), 46 deletions(-) delete mode 100644 _recipes/template.md create mode 100644 bin/recipe.template diff --git a/_recipes/template.md b/_recipes/template.md deleted file mode 100644 index 8b5d3fa6a..000000000 --- a/_recipes/template.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -layout: recipe -title: Template Recipe -image: image-name.jpg -# imagecredit: Rue -categories: [snack] -cuisines: [Mediterranean, Irish, British] -diets: [Vegetarian, GlutenFree] -yield: 4 slices -published: true - -ingredients: - - everything - -directions: - - Copy this file to a new name under the **_recipes** folder - - Set all the options you need for your recipe. - - remove the **published false** line from the front matter. - ---- -This is an example recipe which should contain the full gamut of options available. diff --git a/bin/chowdown b/bin/chowdown index c36b18d40..87fb99974 100755 --- a/bin/chowdown +++ b/bin/chowdown @@ -2,15 +2,13 @@ require 'getoptlong' require 'pathname' -require 'fileutils' opts = GetoptLong.new( [ '--help', '-h', GetoptLong::NO_ARGUMENT ], - [ '--recipe', '-r', GetoptLong::REQUIRED_ARGUMENT ], - [ '--book', '-b', GetoptLong::OPTIONAL_ARGUMENT ] + [ '--recipe', '-r', GetoptLong::REQUIRED_ARGUMENT ] ) -def help +def showhelp puts <<-EOF chowdown OPTION NAME @@ -20,48 +18,72 @@ show help --recipe NAME, -r NAME: create new recipe ---book NAME: -create new book - NAME -The name of the page you want to create +The name of the page you want to create: 'My Fabulous Recipe' EOF end -class Recipe - RECIPEPATH = Pathname('_recipes/') - TEMPLATE = 'template.md' +class Template + @@template = 'recipe.template' + + def initialize(title = 'Autogenerated Example') + @title = title + end - def initialize(name) - @name = name + def targetpath + @targetpath ||= Pathname('.') end def filename - @filename ||= Pathname( - @name.gsub(/[[:space:]]/, '-') + Pathname( + @title.gsub(/[[:space:]]/, '-') .gsub(/[^[:alnum:]-]/, '') .downcase + '.md' ) end + def file_exists? + new_path.exist? + end + + def new_path + targetpath.join(filename) + end + + def template_path + Pathname('./bin').join(@@template) + end + def create! - if RECIPEPATH.join(filename).exist? - puts "That recipe already exists" + new_contents = template_path.read + new_contents['{TITLE}'] = @title + new_contents['{IMAGENAME}'] = filename.sub_ext('.jpg').to_s + + if new_path.exist? + puts "\nThat one already exists, try another name." + puts "Tried to create: #{new_path}" else - FileUtils.cp(RECIPEPATH.join(TEMPLATE), RECIPEPATH.join(filename)) - puts "Go cook!" + new_path.open('w+') {|file| file.write(new_contents) } + + puts "Created: #{new_path}\n Use the same naming structure for any images.\n eg: 'images/#{filename.basename.sub_ext('.jpg')}'" end + + end +end + +# Recipe template +class Recipe < Template + def targetpath + @targetpath ||= Pathname('_recipes') end end opts.each do |opt, arg| case opt - when '--help' - help() - when '--recipe' - Recipe.new(arg).create! - when '--book' - new_book(arg) + when '--help' + showhelp() + when '--recipe' + Recipe.new(arg).create! end end diff --git a/bin/recipe.template b/bin/recipe.template new file mode 100644 index 000000000..ca82322ea --- /dev/null +++ b/bin/recipe.template @@ -0,0 +1,29 @@ +--- +layout: recipe +title: {TITLE} +image: {IMAGENAME} +# imagecredit: +# See: https://schema.org/recipeCategory +# categories: [appetiser, entree, breakfast, snack, lunch, tiffin, dinner, supper] +# See: https://schema.org/recipeCuisine +# cuisines: [Mediterranean, Irish, British, Mexican, French] + +# See: https://schema.org/RestrictedDiet#enumbers +# Diets can only be from the options here, choose all appropriate. +# diets: [DiabeticDiet, GlutenFreeDiet, HalalDiet, HinduDiet, KosherDiet, LowCalorieDiet, LowFatDiet, LowLactoseDiet, LowSaltDiet, VeganDiet, VegetarianDiet] + +# yield: 4 slices +published: true + +ingredients: + - Sugar and spice + - Slugs, snails + - Puppy dog tails + +directions: + - Run the **bin/chowdown** command to copy this file to your **_recipes** folder + - Edit the file it creates to reflect your lovely recipe. + - Copy your images to the images folder. If you don't have any yet just comment out the image line above. + +--- +This is an example recipe which should contain the full gamut of options available. From ff62baa70add0c3915775d9b13c4e9ba531eb3bb Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Wed, 6 May 2020 09:57:28 +0100 Subject: [PATCH 03/13] working better, includes help --- bin/chowdown | 88 ++++++++++++++++++++++++++++++++------------- bin/recipe.template | 36 +++++++++++++------ 2 files changed, 88 insertions(+), 36 deletions(-) diff --git a/bin/chowdown b/bin/chowdown index 87fb99974..2e779681e 100755 --- a/bin/chowdown +++ b/bin/chowdown @@ -1,32 +1,41 @@ #!/usr/bin/env ruby -require 'getoptlong' require 'pathname' -opts = GetoptLong.new( - [ '--help', '-h', GetoptLong::NO_ARGUMENT ], - [ '--recipe', '-r', GetoptLong::REQUIRED_ARGUMENT ] -) +REGISTRY = {} -def showhelp - puts <<-EOF -chowdown OPTION NAME +class Options + def initialize(action, target, name) + available_actions = {new: 'build', delete: 'destroy'} + @action = available_actions.fetch(action.to_sym, 'build') + @target = target + @name = name + end --h, --help: -show help + def self.parse(opts) + action = opts.shift + target = opts.shift + name = opts.shift + self.new(action, target, name) + end ---recipe NAME, -r NAME: -create new recipe + def execute + puts "Chowdown..." + template + .new(@name) + .send(@action) + end -NAME -The name of the page you want to create: 'My Fabulous Recipe' - EOF + def template + Template.lookup(@target.to_sym) + end end + class Template @@template = 'recipe.template' - def initialize(title = 'Autogenerated Example') + def initialize(title = 'Example') @title = title end @@ -54,7 +63,7 @@ class Template Pathname('./bin').join(@@template) end - def create! + def build new_contents = template_path.read new_contents['{TITLE}'] = @title new_contents['{IMAGENAME}'] = filename.sub_ext('.jpg').to_s @@ -67,9 +76,41 @@ class Template puts "Created: #{new_path}\n Use the same naming structure for any images.\n eg: 'images/#{filename.basename.sub_ext('.jpg')}'" end + end + + def destroy + if new_path.exist? + new_path.delete + puts "Deleting: #{new_path}" + else + puts "Can't delete: #{new_path}\nIt does not exist." + end + end + def method_missing(m, *args, &block) + puts 'Usage:' + puts " #{Pathname(__FILE__).basename} ACTION PAGE NAME" + puts " ACTION is one of: new, delete" + puts " PAGE is one of: #{REGISTRY.keys.join(', ')}" + puts " TITLE is the title of the page you are creating." + puts "eg:\n chowdown new recipe 'Grandma\'s Cookies'" end + + def self.register(name, klass) + REGISTRY[name] = klass + end + def self.lookup(name) + REGISTRY[name] + end +end + +# NullTemplate +class NullTemplate < Template + def build; err(:build); end + def destroy; err(:destroy); end end +REGISTRY.default = NullTemplate + # Recipe template class Recipe < Template @@ -77,13 +118,10 @@ class Recipe < Template @targetpath ||= Pathname('_recipes') end end +Template.register(:recipe, Recipe) -opts.each do |opt, arg| - case opt - when '--help' - showhelp() - when '--recipe' - Recipe.new(arg).create! - end -end + + +options = Options.parse(ARGV) +options.execute diff --git a/bin/recipe.template b/bin/recipe.template index ca82322ea..afc6cea37 100644 --- a/bin/recipe.template +++ b/bin/recipe.template @@ -3,15 +3,9 @@ layout: recipe title: {TITLE} image: {IMAGENAME} # imagecredit: -# See: https://schema.org/recipeCategory # categories: [appetiser, entree, breakfast, snack, lunch, tiffin, dinner, supper] -# See: https://schema.org/recipeCuisine # cuisines: [Mediterranean, Irish, British, Mexican, French] - -# See: https://schema.org/RestrictedDiet#enumbers -# Diets can only be from the options here, choose all appropriate. -# diets: [DiabeticDiet, GlutenFreeDiet, HalalDiet, HinduDiet, KosherDiet, LowCalorieDiet, LowFatDiet, LowLactoseDiet, LowSaltDiet, VeganDiet, VegetarianDiet] - +# diets: [Diabetic, GlutenFree, Halal, Hindu, Kosher, LowCalorie, LowFat, LowLactose, LowSalt, Vegan, Vegetarian] # yield: 4 slices published: true @@ -21,9 +15,29 @@ ingredients: - Puppy dog tails directions: - - Run the **bin/chowdown** command to copy this file to your **_recipes** folder - - Edit the file it creates to reflect your lovely recipe. - - Copy your images to the images folder. If you don't have any yet just comment out the image line above. + - Run **bin/chowdown** command to create new **recipes**. + - Edit this file to reflect your lovely new recipe. + - Copy your images to the **images** folder. If you don't have any yet just comment out the image line above. --- -This is an example recipe which should contain the full gamut of options available. +This is an example recipe which should contain the full gamut of options +available. This text is for the freeform description of your recipe. + +Most things conform to the [Recipe schema](https://schema.org/Recipe). Here are some useful shortcuts: + +### Categories + +Usually refer to the [type of meal](https://schema.org/recipeCategory). + + +### Cuisines + +Which [cuisine](https://schema.org/recipeCuisine) does this recipe belong to? + +### Diets + +Diets is a restricted vocabulary and can only be from the [options listed here](https://schema.org/RestrictedDiet#enumbers), choose all that are appropriate. + +### Tags + +Can be anything else you think is relevant to your recipe. You might tag all the ones that you make in the liquidiser with **`blender`** or perhaps all your chicken wing recipes should be tagged with **`barbecue`**. From c0a85035e824d5616e2d622dce9470d268dd9942 Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Wed, 6 May 2020 18:58:37 +0100 Subject: [PATCH 04/13] better output and refactor --- bin/chowdown | 98 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 42 deletions(-) diff --git a/bin/chowdown b/bin/chowdown index 2e779681e..8d335b9a1 100755 --- a/bin/chowdown +++ b/bin/chowdown @@ -2,40 +2,59 @@ require 'pathname' -REGISTRY = {} - class Options + attr_reader :action, :target, :name + def initialize(action, target, name) - available_actions = {new: 'build', delete: 'destroy'} - @action = available_actions.fetch(action.to_sym, 'build') + @action = action @target = target - @name = name + @name = name end def self.parse(opts) - action = opts.shift - target = opts.shift - name = opts.shift + available_actions = { new: 'build', delete: 'destroy' } + available_targets = REGISTRY.keys + + action = available_actions.fetch(opts.shift.to_sym) + target = opts.shift.to_sym + target = available_targets.include?(target) ? target : nil + name = opts.shift || 'Example' self.new(action, target, name) + rescue => e + self.show_usage + end + + def self.show_usage + puts "·C·H·O·W·D·O·W·N·" + puts "Usage:" + puts " #{Pathname(__FILE__).basename} ACTION PAGE NAME" + puts " ACTION is one of: new, delete" + puts " PAGE is one of: #{REGISTRY.keys.join(', ')}" + puts " TITLE is the title of the page you are creating." + puts " eg:\n #{Pathname(__FILE__).basename} new recipe \"Grandma's Cookies\"" end +end - def execute - puts "Chowdown..." +class Chowdown + def self.execute(opts) + return if opts.nil? + @target = opts.target + # puts opts.inspect + puts "·C·H·O·W·D·O·W·N·" template - .new(@name) - .send(@action) + .new(opts.name) + .send(opts.action) end - def template - Template.lookup(@target.to_sym) + def self.template + Template.lookup(@target) end end - class Template - @@template = 'recipe.template' + @@template = 'template.template' - def initialize(title = 'Example') + def initialize(title) @title = title end @@ -52,10 +71,10 @@ class Template end def file_exists? - new_path.exist? + target_file.exist? end - def new_path + def target_file targetpath.join(filename) end @@ -68,52 +87,47 @@ class Template new_contents['{TITLE}'] = @title new_contents['{IMAGENAME}'] = filename.sub_ext('.jpg').to_s - if new_path.exist? - puts "\nThat one already exists, try another name." - puts "Tried to create: #{new_path}" + if target_file.exist? + puts "That one already exists, try another name." + puts "Tried to create: #{target_file}" else - new_path.open('w+') {|file| file.write(new_contents) } + target_file.open('w+') {|file| file.write(new_contents) } - puts "Created: #{new_path}\n Use the same naming structure for any images.\n eg: 'images/#{filename.basename.sub_ext('.jpg')}'" + puts "Created: #{target_file}\n Use the same naming structure for any images.\n eg: 'images/#{filename.basename.sub_ext('.jpg')}'" end end def destroy - if new_path.exist? - new_path.delete - puts "Deleting: #{new_path}" + if target_file.exist? + target_file.delete + puts "Deleting: #{target_file}" else - puts "Can't delete: #{new_path}\nIt does not exist." + puts "Can't delete: #{target_file}\nIt does not exist." end end def method_missing(m, *args, &block) - puts 'Usage:' - puts " #{Pathname(__FILE__).basename} ACTION PAGE NAME" - puts " ACTION is one of: new, delete" - puts " PAGE is one of: #{REGISTRY.keys.join(', ')}" - puts " TITLE is the title of the page you are creating." - puts "eg:\n chowdown new recipe 'Grandma\'s Cookies'" + puts ['* method:', m, args] + Options.show_usage end def self.register(name, klass) REGISTRY[name] = klass end def self.lookup(name) - REGISTRY[name] + REGISTRY[name.to_s.to_sym] end end # NullTemplate -class NullTemplate < Template - def build; err(:build); end - def destroy; err(:destroy); end -end -REGISTRY.default = NullTemplate +class NullTemplate < Template; end +REGISTRY = Hash.new(NullTemplate) # Recipe template class Recipe < Template + @@template = 'recipe.template' + def targetpath @targetpath ||= Pathname('_recipes') end @@ -122,6 +136,6 @@ Template.register(:recipe, Recipe) - +# Load the options and execute options = Options.parse(ARGV) -options.execute +Chowdown.execute(options) From 1e34aefc2b0c3c6958fc9971ff86acc0d3b70184 Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Wed, 6 May 2020 19:11:58 +0100 Subject: [PATCH 05/13] remove serve for now --- bin/serve | 1 - 1 file changed, 1 deletion(-) delete mode 100755 bin/serve diff --git a/bin/serve b/bin/serve deleted file mode 100755 index 52eb4848b..000000000 --- a/bin/serve +++ /dev/null @@ -1 +0,0 @@ -bundle exec jekyll serve --trace -H 0.0.0.0 -P 8080 From 80b30a46ffa2d99ae39683829e37f54f00d12648 Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Sat, 30 May 2020 13:31:51 +0100 Subject: [PATCH 06/13] build tool and VERSION --- VERSION | 1 + bin/build | 8 ++++++++ bin/chowdown | 5 +++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 VERSION create mode 100755 bin/build diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..8acdd82b7 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.1 diff --git a/bin/build b/bin/build new file mode 100755 index 000000000..35375cee9 --- /dev/null +++ b/bin/build @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +DESTINATION=${1:-/Volumes/share/chowdown} +BASEURL=${1:-http://hatouch.local} + +echo "Building site to " . $DESTINATION + +jekyll build -d $DESTINATION -b $BASEURL --trace diff --git a/bin/chowdown b/bin/chowdown index 8d335b9a1..86307866a 100755 --- a/bin/chowdown +++ b/bin/chowdown @@ -1,6 +1,7 @@ #!/usr/bin/env ruby require 'pathname' +VERSION = Pathname(__FILE__).join('../../VERSION').read class Options attr_reader :action, :target, :name @@ -25,7 +26,7 @@ class Options end def self.show_usage - puts "·C·H·O·W·D·O·W·N·" + puts "Chowdown v#{VERSION}" puts "Usage:" puts " #{Pathname(__FILE__).basename} ACTION PAGE NAME" puts " ACTION is one of: new, delete" @@ -40,7 +41,7 @@ class Chowdown return if opts.nil? @target = opts.target # puts opts.inspect - puts "·C·H·O·W·D·O·W·N·" + puts "Chowdown v#{VERSION}" template .new(opts.name) .send(opts.action) From 1be88c93df2a03930b4d9def439e072dfd61ebfb Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Thu, 18 Jun 2020 09:41:04 +0100 Subject: [PATCH 07/13] add destination check --- bin/build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/build b/bin/build index 35375cee9..fde719d21 100755 --- a/bin/build +++ b/bin/build @@ -3,6 +3,11 @@ DESTINATION=${1:-/Volumes/share/chowdown} BASEURL=${1:-http://hatouch.local} +if ! [ -d "$DESTINATION" ]; then + echo "Destination does not exist: $DESTINATION" + exit 1 +fi + echo "Building site to " . $DESTINATION jekyll build -d $DESTINATION -b $BASEURL --trace From 0f88e86276ba92ad16b8ffc287ec405f960e2133 Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Sat, 7 Nov 2020 06:26:00 +0000 Subject: [PATCH 08/13] Update build --- bin/build | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/build b/bin/build index fde719d21..39d49fbfc 100755 --- a/bin/build +++ b/bin/build @@ -1,13 +1,14 @@ #!/usr/bin/env bash DESTINATION=${1:-/Volumes/share/chowdown} -BASEURL=${1:-http://hatouch.local} +BASEURL=${2:-http://chowdown.local} if ! [ -d "$DESTINATION" ]; then echo "Destination does not exist: $DESTINATION" exit 1 fi -echo "Building site to " . $DESTINATION +echo "Building site to $DESTINATION" +echo "URL will be $BASEURL" -jekyll build -d $DESTINATION -b $BASEURL --trace +jekyll build -d $DESTINATION -b $BASEURL --trace --incremental From 12d01a5901d707ac0d6b105b64c046574d1860a2 Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Sat, 7 Nov 2020 06:29:16 +0000 Subject: [PATCH 09/13] Update chowdown --- bin/chowdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/chowdown b/bin/chowdown index 86307866a..856ac4d74 100755 --- a/bin/chowdown +++ b/bin/chowdown @@ -31,7 +31,7 @@ class Options puts " #{Pathname(__FILE__).basename} ACTION PAGE NAME" puts " ACTION is one of: new, delete" puts " PAGE is one of: #{REGISTRY.keys.join(', ')}" - puts " TITLE is the title of the page you are creating." + puts " NAME is the title of the page you are creating." puts " eg:\n #{Pathname(__FILE__).basename} new recipe \"Grandma's Cookies\"" end end From 5390117d3ac5aec3cdd155f5440e4bd643f64c47 Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Mon, 9 Nov 2020 19:51:23 +0000 Subject: [PATCH 10/13] more info and exit option --- bin/build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/build b/bin/build index 39d49fbfc..ae1d950a9 100755 --- a/bin/build +++ b/bin/build @@ -2,13 +2,20 @@ DESTINATION=${1:-/Volumes/share/chowdown} BASEURL=${2:-http://chowdown.local} +BRANCH=$(git branch --show-current) if ! [ -d "$DESTINATION" ]; then echo "Destination does not exist: $DESTINATION" exit 1 fi -echo "Building site to $DESTINATION" +echo "Building site ($BRANCH) to $DESTINATION" echo "URL will be $BASEURL" -jekyll build -d $DESTINATION -b $BASEURL --trace --incremental +echo "Go ahead with build?" +select yn in "Yes" "No"; do + case $yn in + Yes ) jekyll build -d $DESTINATION -b $BASEURL --trace --incremental; break;; + No ) echo "Exiting."; exit;; + esac +done From bd522371399a45030a53ce8ee5264ebb996155d8 Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Tue, 10 Nov 2020 10:08:39 +0000 Subject: [PATCH 11/13] categories => courses --- bin/recipe.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/recipe.template b/bin/recipe.template index afc6cea37..08f0e7e1c 100644 --- a/bin/recipe.template +++ b/bin/recipe.template @@ -3,7 +3,7 @@ layout: recipe title: {TITLE} image: {IMAGENAME} # imagecredit: -# categories: [appetiser, entree, breakfast, snack, lunch, tiffin, dinner, supper] +# courses: [appetiser, entree, breakfast, snack, lunch, tiffin, dinner, supper] # cuisines: [Mediterranean, Irish, British, Mexican, French] # diets: [Diabetic, GlutenFree, Halal, Hindu, Kosher, LowCalorie, LowFat, LowLactose, LowSalt, Vegan, Vegetarian] # yield: 4 slices @@ -25,9 +25,9 @@ available. This text is for the freeform description of your recipe. Most things conform to the [Recipe schema](https://schema.org/Recipe). Here are some useful shortcuts: -### Categories +### Courses -Usually refer to the [type of meal](https://schema.org/recipeCategory). +Refer to the [type of meal](https://schema.org/recipeCategory). ### Cuisines From fbb17fb24d1daaff1fda45e42e86bb6e4a391b1d Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Tue, 26 Jan 2021 11:30:12 +0000 Subject: [PATCH 12/13] Add incremental option --- bin/build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/build b/bin/build index ae1d950a9..4269cb8ff 100755 --- a/bin/build +++ b/bin/build @@ -15,7 +15,17 @@ echo "URL will be $BASEURL" echo "Go ahead with build?" select yn in "Yes" "No"; do case $yn in - Yes ) jekyll build -d $DESTINATION -b $BASEURL --trace --incremental; break;; + Yes ) echo "Ok."; break;; No ) echo "Exiting."; exit;; esac done + +echo "Incremental or full?" +select choice in "Incremental" "Full"; do + case $choice in + Incremental ) INCREMENTAL="--incremental"; break;; + Full ) INCREMENTAL=""; break;; + esac +done + +jekyll build -d $DESTINATION -b $BASEURL --trace $INCREMENTAL From 4a60e8a7750dd771823a7af67c7bcdfbd3c49c9d Mon Sep 17 00:00:00 2001 From: Rue Turner Date: Wed, 17 Feb 2021 10:38:34 +0000 Subject: [PATCH 13/13] Simplify build options --- bin/build | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/build b/bin/build index 4269cb8ff..95847ea1e 100755 --- a/bin/build +++ b/bin/build @@ -12,19 +12,20 @@ fi echo "Building site ($BRANCH) to $DESTINATION" echo "URL will be $BASEURL" -echo "Go ahead with build?" -select yn in "Yes" "No"; do - case $yn in - Yes ) echo "Ok."; break;; - No ) echo "Exiting."; exit;; - esac -done +# echo "Go ahead with build?" +# select yn in "Yes" "No"; do +# case $yn in +# Yes ) echo "Ok."; break;; +# No ) echo "Exiting."; exit;; +# esac +# done echo "Incremental or full?" -select choice in "Incremental" "Full"; do +select choice in "Incremental" "Full" "Quit"; do case $choice in Incremental ) INCREMENTAL="--incremental"; break;; Full ) INCREMENTAL=""; break;; + Quit ) echo "Exiting."; exit;; esac done