Compare commits
No commits in common. "1d295e27f54ce982a323218014c9314bb1448680" and "d7770efb2ef8b4bb83c0e697617f59728eb1b99e" have entirely different histories.
1d295e27f5
...
d7770efb2e
9 changed files with 82 additions and 48 deletions
|
@ -5,3 +5,4 @@ pipeline:
|
||||||
- gem install bundler
|
- gem install bundler
|
||||||
- bundle install --jobs=4
|
- bundle install --jobs=4
|
||||||
- bundle exec jekyll build
|
- bundle exec jekyll build
|
||||||
|
- bundle exec htmlproofer ./_site --disable-external
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,4 +5,3 @@ _subrecipes
|
||||||
.jekyll-cache
|
.jekyll-cache
|
||||||
.jekyll-metadata
|
.jekyll-metadata
|
||||||
vendor
|
vendor
|
||||||
.bundle/
|
|
5
Gemfile
5
Gemfile
|
@ -7,7 +7,10 @@ source "https://rubygems.org"
|
||||||
#
|
#
|
||||||
# This will help ensure the proper Jekyll version is running.
|
# This will help ensure the proper Jekyll version is running.
|
||||||
# Happy Jekylling!
|
# Happy Jekylling!
|
||||||
gem "jekyll", "~> 4.0.0"
|
# gem "jekyll", "~> 4.0.0"
|
||||||
|
gem "nokogiri", ">= 1.11.0.rc1"
|
||||||
|
gem "jekyll", github: "jekyll/jekyll"
|
||||||
|
gem "html-proofer"
|
||||||
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
||||||
# gem "minima", "~> 2.5"
|
# gem "minima", "~> 2.5"
|
||||||
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
||||||
|
|
63
Gemfile.lock
63
Gemfile.lock
|
@ -1,19 +1,7 @@
|
||||||
GEM
|
GIT
|
||||||
remote: https://rubygems.org/
|
remote: https://github.com/jekyll/jekyll.git
|
||||||
|
revision: ab6ef0b257e4c7aafec0518d93bea3e9c4b75b75
|
||||||
specs:
|
specs:
|
||||||
addressable (2.7.0)
|
|
||||||
public_suffix (>= 2.0.2, < 5.0)
|
|
||||||
colorator (1.1.0)
|
|
||||||
concurrent-ruby (1.1.6)
|
|
||||||
em-websocket (0.5.1)
|
|
||||||
eventmachine (>= 0.12.9)
|
|
||||||
http_parser.rb (~> 0.6.0)
|
|
||||||
eventmachine (1.2.7)
|
|
||||||
ffi (1.12.2)
|
|
||||||
forwardable-extended (2.6.0)
|
|
||||||
http_parser.rb (0.6.0)
|
|
||||||
i18n (1.8.2)
|
|
||||||
concurrent-ruby (~> 1.0)
|
|
||||||
jekyll (4.0.0)
|
jekyll (4.0.0)
|
||||||
addressable (~> 2.4)
|
addressable (~> 2.4)
|
||||||
colorator (~> 1.0)
|
colorator (~> 1.0)
|
||||||
|
@ -24,11 +12,38 @@ GEM
|
||||||
kramdown (~> 2.1)
|
kramdown (~> 2.1)
|
||||||
kramdown-parser-gfm (~> 1.0)
|
kramdown-parser-gfm (~> 1.0)
|
||||||
liquid (~> 4.0)
|
liquid (~> 4.0)
|
||||||
mercenary (~> 0.3.3)
|
mercenary (~> 0.4.0)
|
||||||
pathutil (~> 0.9)
|
pathutil (~> 0.9)
|
||||||
rouge (~> 3.0)
|
rouge (~> 3.0)
|
||||||
safe_yaml (~> 1.0)
|
safe_yaml (~> 1.0)
|
||||||
terminal-table (~> 1.8)
|
terminal-table (~> 1.8)
|
||||||
|
|
||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
addressable (2.7.0)
|
||||||
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
|
colorator (1.1.0)
|
||||||
|
concurrent-ruby (1.1.6)
|
||||||
|
em-websocket (0.5.1)
|
||||||
|
eventmachine (>= 0.12.9)
|
||||||
|
http_parser.rb (~> 0.6.0)
|
||||||
|
ethon (0.12.0)
|
||||||
|
ffi (>= 1.3.0)
|
||||||
|
eventmachine (1.2.7)
|
||||||
|
ffi (1.12.2)
|
||||||
|
forwardable-extended (2.6.0)
|
||||||
|
html-proofer (3.15.1)
|
||||||
|
addressable (~> 2.3)
|
||||||
|
mercenary (~> 0.3)
|
||||||
|
nokogumbo (~> 2.0)
|
||||||
|
parallel (~> 1.3)
|
||||||
|
rainbow (~> 3.0)
|
||||||
|
typhoeus (~> 1.3)
|
||||||
|
yell (~> 2.0)
|
||||||
|
http_parser.rb (0.6.0)
|
||||||
|
i18n (1.8.2)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
jekyll-sass-converter (2.1.0)
|
jekyll-sass-converter (2.1.0)
|
||||||
sassc (> 2.0.1, < 3.0)
|
sassc (> 2.0.1, < 3.0)
|
||||||
jekyll-watch (2.2.1)
|
jekyll-watch (2.2.1)
|
||||||
|
@ -40,10 +55,17 @@ GEM
|
||||||
listen (3.2.1)
|
listen (3.2.1)
|
||||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
rb-inotify (~> 0.9, >= 0.9.10)
|
rb-inotify (~> 0.9, >= 0.9.10)
|
||||||
mercenary (0.3.6)
|
mercenary (0.4.0)
|
||||||
|
mini_portile2 (2.4.0)
|
||||||
|
nokogiri (1.11.0.rc1)
|
||||||
|
mini_portile2 (~> 2.4.0)
|
||||||
|
nokogumbo (2.0.2)
|
||||||
|
nokogiri (~> 1.8, >= 1.8.4)
|
||||||
|
parallel (1.19.1)
|
||||||
pathutil (0.16.2)
|
pathutil (0.16.2)
|
||||||
forwardable-extended (~> 2.6)
|
forwardable-extended (~> 2.6)
|
||||||
public_suffix (4.0.3)
|
public_suffix (4.0.3)
|
||||||
|
rainbow (3.0.0)
|
||||||
rb-fsevent (0.10.3)
|
rb-fsevent (0.10.3)
|
||||||
rb-inotify (0.10.1)
|
rb-inotify (0.10.1)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
|
@ -54,18 +76,23 @@ GEM
|
||||||
terminal-table (1.8.0)
|
terminal-table (1.8.0)
|
||||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
|
typhoeus (1.3.1)
|
||||||
|
ethon (>= 0.9.0)
|
||||||
tzinfo (1.2.6)
|
tzinfo (1.2.6)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
tzinfo-data (1.2019.3)
|
tzinfo-data (1.2019.3)
|
||||||
tzinfo (>= 1.0.0)
|
tzinfo (>= 1.0.0)
|
||||||
unicode-display_width (1.6.1)
|
unicode-display_width (1.6.1)
|
||||||
wdm (0.1.1)
|
wdm (0.1.1)
|
||||||
|
yell (2.2.2)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
jekyll (~> 4.0.0)
|
html-proofer
|
||||||
|
jekyll!
|
||||||
|
nokogiri (>= 1.11.0.rc1)
|
||||||
tzinfo (~> 1.2)
|
tzinfo (~> 1.2)
|
||||||
tzinfo-data
|
tzinfo-data
|
||||||
wdm (~> 0.1.1)
|
wdm (~> 0.1.1)
|
||||||
|
|
30
_includes/difficulty_stars.html
Normal file
30
_includes/difficulty_stars.html
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{%- if page.difficulty or recipe.difficulty -%}
|
||||||
|
{%- if page.difficulty -%}
|
||||||
|
{%- assign difficulty = page.difficulty -%}
|
||||||
|
{%- else -%}
|
||||||
|
{%- assign difficulty = recipe.difficulty -%}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{%- if difficulty < 6 and difficulty > 0 -%}
|
||||||
|
{%- comment -%} note: these characters are invalid unicode. they will only render properly on the webpage using the bundled "stars" font. {%- endcomment -%}
|
||||||
|
{%- assign empty_star ="" -%}
|
||||||
|
{%- assign full_star = "" -%}
|
||||||
|
{%- assign half_star = "" -%}
|
||||||
|
|
||||||
|
{%- comment -%} build a string of empty stars {%- endcomment -%}
|
||||||
|
{%- assign stars = "" -%}
|
||||||
|
{%- for i in (1..5) -%}
|
||||||
|
{%- assign stars = stars | append: empty_star -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- comment -%} replace the first difficulty stars will filled stars {%- endcomment -%}
|
||||||
|
{%- assign page_stars_rounded = difficulty | floor -%}
|
||||||
|
{%- for i in (1..page_stars_rounded) -%}
|
||||||
|
{%- assign stars = stars | replace_first: empty_star, full_star -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- if difficulty != page_stars_rounded -%}
|
||||||
|
{%- comment -%} stars ends in .5 (or .1, or .9, or whatever) {%- endcomment -%}
|
||||||
|
{%- assign stars = stars | replace_first: empty_star, half_star -%}
|
||||||
|
{%- endif -%}
|
||||||
|
<span class='stars'>{{ stars }}</span>
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
|
@ -4,7 +4,7 @@
|
||||||
<h3>{{ recipe.name }}</h3>
|
<h3>{{ recipe.name }}</h3>
|
||||||
<p>
|
<p>
|
||||||
By {{ recipe.author }} -
|
By {{ recipe.author }} -
|
||||||
{% if recipe.difficulty %}Difficulty: <span class='stars'>{{ recipe.difficulty | to_stars }}</span> - {%- endif %}
|
{% if recipe.difficulty %}Difficulty: {% include difficulty_stars.html %} - {%- endif %}
|
||||||
{{ recipe.method | size }} steps {%- if recipe.time %} -
|
{{ recipe.method | size }} steps {%- if recipe.time %} -
|
||||||
{%- if recipe.time > 59 %} {{ recipe.time | divided_by: 60}}h {% endif -%}
|
{%- if recipe.time > 59 %} {{ recipe.time | divided_by: 60}}h {% endif -%}
|
||||||
{% assign mins = recipe.time | modulo: 60 -%}
|
{% assign mins = recipe.time | modulo: 60 -%}
|
||||||
|
|
|
@ -31,7 +31,7 @@ custom_h1: true
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
<p class='subtle'>{% if page.difficulty %}Difficulty: <span class='stars'>{{ page.difficulty | to_stars }}</span> - {% endif %}{{ page.method.size }} steps - Estimated cooking time: {{ time | default: "Not provided" }} {% if page.author %} - By {{ page.author }} {% endif %}</p>
|
<p class='subtle'>{% if page.difficulty %}Difficulty: {% include difficulty_stars.html %} - {% endif %}{{ page.method.size }} steps - Estimated cooking time: {{ time | default: "Not provided" }} {% if page.author %} - By {{ page.author }} {% endif %}</p>
|
||||||
{%- if applicable_subrecipes %}
|
{%- if applicable_subrecipes %}
|
||||||
<h2> Subrecipes </h2>
|
<h2> Subrecipes </h2>
|
||||||
{% for subrecipe in site.subrecipes -%}
|
{% for subrecipe in site.subrecipes -%}
|
||||||
|
|
|
@ -35,27 +35,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
"<span title='#{input}'>#{leading_integer != "0" ? "#{leading_integer} " : ""}<span class='fraction'><span class='numerator'>#{rational.numerator}</span><span class='denominator'>#{rational.denominator}</span></span></span>"
|
"<span title='#{input}'>#{leading_integer != "0" ? "#{leading_integer} " : ""}<span class='fraction'><span class='numerator'>#{rational.numerator}</span><span class='denominator'>#{rational.denominator}</span></span></span>"
|
||||||
end
|
|
||||||
|
|
||||||
def to_stars(input)
|
|
||||||
input = input.to_i
|
|
||||||
if input <= 0 or input > 5
|
|
||||||
return "[invalid difficulty value: #{input}. difficulty must be between 0.5 and 5 (inclusive)]"
|
|
||||||
end
|
|
||||||
|
|
||||||
# the "star" characters are invalid unicode but will render properly on the webpage when using the 'stars' font
|
|
||||||
empty_star, half_star, full_star = "", "", ""
|
|
||||||
out = full_star * input.floor
|
|
||||||
|
|
||||||
if input.floor != input
|
|
||||||
out += half_star
|
|
||||||
end
|
|
||||||
|
|
||||||
while out.length != 5
|
|
||||||
out += empty_star
|
|
||||||
end
|
|
||||||
|
|
||||||
out
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,18 +10,12 @@ body {
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main {
|
#main {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
max-width: 1500px;
|
max-width: 1500px;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
@media screen and (max-width: 900px) {
|
|
||||||
#main {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
Loading…
Reference in a new issue