Skip to content
Snippets Groups Projects
Verified Commit 25661c66 authored by Jake's avatar Jake :speech_balloon:
Browse files

added renderers.html

parent c4dfd3da
No related branches found
No related tags found
No related merge requests found
{%- import 'macros/getters.html' as get with context -%}
{%- import 'macros/cards.html' as cards with context -%}
{%- macro section_news(s, lang) -%}
{{ cards.cards_from_pages(pages_modified, max=s.num) }}
{%- endmacro -%}
{%- macro section_custom(s, lang) -%}
{{ cards.open() }}
{%- for c in s.content -%}
{{ cards.card(title=c[lang], url=c.url, catcolor=c.color) }}
{%- endfor -%}
{{ cards.close() }}
{%- endmacro -%}
{%- macro section_iframe(s, lang) -%}
<iframe src="{{ s.url }}"></iframe>
{%- endmacro -%}
{%- macro section_tag(s, lang) -%}
{%- call(tagtitle, tagcolor, tagurl, tagpage, tagpages) get.tag_by_name(s.tag, lang) -%}
{%- if s.title is not defined -%}
<header>
<h2 {% if s.id is defined -%}id="{{ s.id }}"{%- endif %}>{{ tagtitle|e }}</h2>
</header>
{%- endif -%}
{{ cards.cards_from_pages(tagpages, lang, max=s.num) }}
{%- if tagpage -%}
{{ tagpage.content }}
{%- endif -%}
{%- endcall -%}
{%- endmacro -%}
{%- macro section(s, lang) -%}
{%- if s.title is defined -%}
<header>
<h2 {% if s.id is defined -%}id="{{ s.id }}"{%- endif %}>{{ s.title[lang]|e }}</h2>
</header>
{%- endif -%}
{%- if s.type == "news" -%}
{{ section_news(s, lang) }}
{%- elif s.type == "iframe" -%}
{{ section_iframe(s, lang) }}
{%- elif s.type == "custom" -%}
{{ section_custom(s, lang) }}
{%- elif s.type == "tag" -%}
{{ section_tag(s, lang) }}
{%- else -%}
<br />
<strong>ERROR: render.section: Unknown section type: {{ s.type|e }}</strong><br />
<br />
{%- endif -%}
{%- endmacro -%}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment