This commit is contained in:
Peder Bergebakken Sundt 2019-10-20 03:37:24 +02:00
parent 89b20b04a5
commit 3ed09663b9

View File

@ -1,4 +1,4 @@
{% set xml_image_note_done = [1] %}{# why must nunjucks suck so much? #}
{% set xml_image_not_done = [1] %}{# why must nunjucks suck so much? #}
{% macro figure_layer(figure) %}
{% set figure_style %}{% filter cull_whitespace %}
@ -31,7 +31,7 @@
{% if figure.source == "xml" %}
{% set figure_name = xml.image if xml.image | startswith("http") else xml.image | split(":") | tail | join(":") %}
{% set figure_source = "url" if xml.image | startswith("http") else xml.image | split(":") | first %}
{% if xml_image_note_done.clear() %}{% endif %}
{% if xml_image_not_done.pop() %}{% endif %}
{% else %}
{% set figure_name = figure.name %}
{% set figure_source = figure.source %}
@ -98,7 +98,7 @@
{% for figure in yaml.figures or [] %}
{{ figure_layer(figure) }}
{% endfor %}
{% if xml.image and xml_image_note_done %}
{% if xml.image and xml_image_not_done | length %}
{{ figure_layer({
'name': xml.image if xml.image | startswith("http") else xml.image | split(":") | tail | join(":"),
'source': "url" if xml.image | startswith("http") else xml.image | split(":") | first