From 289b8899882d87911815283fa4ef6abd107617ad Mon Sep 17 00:00:00 2001 From: Aaron Traas Date: Sat, 30 Nov 2024 11:45:57 -0500 Subject: [PATCH] Updated template to insert hero image --- Gemfile | 4 ++++ Recipes/Sourdough/Basic No-Knead Sourdough.md | 3 +-- _layouts/default.html | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 3d715de..4ed5fc7 100644 --- a/Gemfile +++ b/Gemfile @@ -37,3 +37,7 @@ gem "wdm", "~> 0.1.0", :platforms => [:mingw, :x64_mingw, :mswin] # kramdown v1, comment out this line. gem "kramdown-parser-gfm" + +gem "webrick", "~> 1.9" + +gem "jekyll", "~> 3.9" diff --git a/Recipes/Sourdough/Basic No-Knead Sourdough.md b/Recipes/Sourdough/Basic No-Knead Sourdough.md index 5ec5e78..2e9b722 100644 --- a/Recipes/Sourdough/Basic No-Knead Sourdough.md +++ b/Recipes/Sourdough/Basic No-Knead Sourdough.md @@ -2,12 +2,11 @@ description: Quality rustic sourdough. Very few bakeries make a better loaf. tags: sourdough ingredients: flour, sourdough-starter +hero_image: sourdough.jpg --- # Basic No-Knead Sourdough -![Rustic Sourdough](../../images/sourdough.jpg) - From my dear friend, Kevin. He graciously gave me some of his starter, and this recipe, and I've made it about 4 times now. It's awesome. Converting it here to a recipe format which I can read and parse quickly. Also halved the recipe, as this is too much for me to use at once. Also, I've had better results in my oven with a lower temperature than his recipe called for. ## Ingredients: diff --git a/_layouts/default.html b/_layouts/default.html index 441583a..75b7337 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -29,7 +29,20 @@

{{ site.description | default: site.github.project_tagline }}

- {{ content }} + {% if page.hero_image != nil -%} + {% assign content_pieces = content | split: "" %} + {% assign content_pieces_count = content_pieces | size %} + {% if content_pieces_count > 1 -%} + {% assign content_snipped = content_pieces | shift | join: "" %} + {% else -%} + {% assign content_snipped = content_pieces | join: "" %} + {% endif -%} +

{{ page.title }}

+ + {{ content_snipped }} + {% else -%} + {{ content }} + {% endif -%}