fixed a typo in a comment. and they said i couldn't code.

This commit is contained in:
Lynne Megido 2020-03-01 06:13:36 +10:00
parent ac2c1c9680
commit 5fd8e0b21e
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90

View File

@ -1,7 +1,7 @@
---
layout: default
---
{%- comment -%} this is a gross method of convertin "_recipes/example.md" to "example". it does it by removing the leading "_recipes/", which is simple enough, and then the trailing ".md", which is done by converting the string to an array, reversing it, turning it back into a string, removing the leading "dm." (".md" backwards), and doing the the array -> reverse -> string shuffle again. it's ugly but hey it works right {%- endcomment -%}
{%- comment -%} this is a gross method of converting "_recipes/example.md" to "example". it does it by removing the leading "_recipes/", which is simple enough, and then the trailing ".md", which is done by converting the string to an array, reversing it, turning it back into a string, removing the leading "dm." (".md" backwards), and doing the the array -> reverse -> string shuffle again. it's ugly but hey it works right {%- endcomment -%}
{%- assign id = page.path | remove_first: "_recipes/" | split: "" | reverse | join: "" | remove_first: "dm." | split: "" | reverse | join: "" -%}
{%- comment -%} unfortunately we have to iterate through the entire subrecipe folder twice - once to see if there are any subrecipes that apply here, and another time to put them in. thankfully we can break out of the first loop if we find a single match. i miss jinja ;u; {%- endcomment -%}
{%- assign applicable_subrecipes = false -%}