]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Define macro for weblink.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 26 Oct 2021 07:22:52 +0000 (09:22 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 26 Oct 2021 07:22:52 +0000 (09:22 +0200)
wrpylib/templates/sledrun_wiki.txt

index 42fc580449b332b720f027e25920c9104daff9c2..06e432b3a6ec208fbf01143a0a62473ae8bcb076 100644 (file)
@@ -1,4 +1,7 @@
 {% block content %}
+{%- macro weblink(value) -%}
+{% if value.text %}[{{ value.url }} {{ value.text }}]{% else %}{{ value.url }}{% endif %}
+{%- endmacro %}
 == Allgemeines ==
 {{ rodelbahnbox }}
 {{ description | default("*Hier wird die Rodelbahn allgemein beschrieben.*") | from_markdown | trim }}
@@ -16,7 +19,7 @@
 ** {{ info.phone }} ({{ info.name }})
 {%- endfor %}
 {%- for info in info_web %}
-** {% if info.text %}[{{ info.url }} {{ info.text }}]{% else %}{{ info.url }}{% endif %}
+** {{ weblink(info) }}
 {%- endfor %}
 * '''Betreiber''': {{ operator }}
 * '''Hütten''':
@@ -32,7 +35,7 @@
 {% endfor -%}
 * '''Siehe auch''':
 {%- for info in see_also %}
-** {% if info.text %}[{{ info.url }} {{ info.text }}]{% else %}{{ info.url }}{% endif %}
+** {{ weblink(info) }}
 {%- endfor %}