Skip to content

Commit

Permalink
Updated template to insert hero image
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronTraas committed Nov 30, 2024
1 parent 244e928 commit 289b889
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 1 addition & 2 deletions Recipes/Sourdough/Basic No-Knead Sourdough.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 14 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,20 @@ <h2>{{ site.description | default: site.github.project_tagline }}</h2>
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content">
{{ content }}
{% if page.hero_image != nil -%}
{% assign content_pieces = content | split: "</h1>" %}
{% assign content_pieces_count = content_pieces | size %}
{% if content_pieces_count > 1 -%}
{% assign content_snipped = content_pieces | shift | join: "</h1>" %}
{% else -%}
{% assign content_snipped = content_pieces | join: "</h1>" %}
{% endif -%}
<h1>{{ page.title }}</h1>
<img src="{{ '/images/' | append: page.hero_image | relative_url }}" />
{{ content_snipped }}
{% else -%}
{{ content }}
{% endif -%}
</section>

<a href="#" id="hamburger"></a>
Expand Down

0 comments on commit 289b889

Please sign in to comment.