diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2022-12-17 22:07:18 +0100 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2022-12-17 22:07:18 +0100 |
commit | b6b157bc9f9445a716692ea599af7f6e4a69c849 (patch) | |
tree | 3c5bad829159181d7fbed5b7d7e1612c8ec42046 /templates/shortcodes | |
parent | 2e90f71d547dd9294a26861b66b6344bc49ab9af (diff) | |
download | blog-b6b157bc9f9445a716692ea599af7f6e4a69c849.tar.gz blog-b6b157bc9f9445a716692ea599af7f6e4a69c849.zip |
template: fix whitespacing
Diffstat (limited to 'templates/shortcodes')
-rw-r--r-- | templates/shortcodes/include.md | 4 | ||||
-rw-r--r-- | templates/shortcodes/include_range.md | 26 | ||||
-rw-r--r-- | templates/shortcodes/include_url.md | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/templates/shortcodes/include.md b/templates/shortcodes/include.md index 4fd692c..163f5a0 100644 --- a/templates/shortcodes/include.md +++ b/templates/shortcodes/include.md @@ -1,2 +1,2 @@ -{% set data = load_data(path=path) %} -{{ data }} +{% set data = load_data(path=path) -%} +{{ data -}} diff --git a/templates/shortcodes/include_range.md b/templates/shortcodes/include_range.md index cfcce76..b8ec9e5 100644 --- a/templates/shortcodes/include_range.md +++ b/templates/shortcodes/include_range.md @@ -1,17 +1,17 @@ -{# Args: #} -{# path - file to load #} -{# start - start line #} -{# end - end line #} -{# #} -{# Example: #} -{# {{ include_range(path="..", start=1, end=2) }} #} +{#- Args: -#} +{#- path - file to load -#} +{#- start - start line -#} +{#- end - end line -#} +{#- -#} +{#- Example: -#} +{#- {{ include_range(path="..", start=1, end=2) }} -#} -{% set data = load_data(path=path) | split(pat="\n") | slice(start=start-1, end=end) %} +{% set data = load_data(path=path) | split(pat="\n") | slice(start=start-1, end=end) -%} {% for line in data -%} - {{ line }} -{% endfor %} + {{ line -}} +{% endfor -%} -{# The '-' in the for loop is important, it removes the whitespaces after the stmt. #} -{# See: https://tera.netlify.app/docs/#whitespace-control #} +{#- The '-' in the for loop is important, it removes the whitespaces after the stmt. -#} +{#- See: https://tera.netlify.app/docs/#whitespace-control -#} -{# Note: I wasn't able to pull this off with a join(), maybe I'll debug one day. #} +{#- Note: I wasn't able to pull this off with a join(), maybe I'll debug one day. -#} diff --git a/templates/shortcodes/include_url.md b/templates/shortcodes/include_url.md new file mode 100644 index 0000000..3cb1f67 --- /dev/null +++ b/templates/shortcodes/include_url.md @@ -0,0 +1,2 @@ +{% set data = load_data(url=url) %} +{{ data }} |