Skip to content
Snippets Groups Projects
Verified Commit d2915b02 authored by Jake's avatar Jake
Browse files

added section_relevant() renderer and fixed max not working correctly

parent 68707ab1
No related branches found
No related tags found
No related merge requests found
Pipeline #313267 passed
......@@ -28,7 +28,7 @@
{{ open() }}
{%- endif -%}
{%- for page in pages -%}
{%- if max == None or loop.index < max -%}
{%- if max is none or loop.index < max -%}
{{ cards.card_from_page(page, lang) }}
{%- endif -%}
{%- endfor -%}
......
......@@ -3,7 +3,11 @@
{%- import 'macros/content_renderer.html' as content_renderer with context -%}
{%- macro section_news(s, lang) -%}
{{ cards.cards_from_pages(pages_modified, max=s.num) }}
{{ cards.cards_from_pages(pages_modified, max=s.num|d(None)) }}
{%- endmacro -%}
{%- macro section_relevant(s, lang) -%}
{{ cards.cards_from_pages(relevant_pages, max=s.num|d(None)) }}
{%- endmacro -%}
{%- macro section_custom(s, lang) -%}
......@@ -29,7 +33,7 @@
<h2 {% if s.id is defined -%}id="{{ s.id }}"{%- endif %}>{{ tagtitle|e }}</h2>
</header>
{%- endif -%}
{{ cards.cards_from_pages(tagpages, lang, max=s.num) }}
{{ cards.cards_from_pages(tagpages, lang, max=s.num|d(None)) }}
{%- if tagpage -%}
{{ content_renderer.render_content(tagpage.content, lang) }}
......@@ -51,6 +55,8 @@
{{ section_custom(s, lang) }}
{%- elif s.type == "tag" -%}
{{ section_tag(s, lang) }}
{%- elif s.type == "relevant" -%}
{{ section_relevant(s, lang) }}
{%- else -%}
<br />
<strong>ERROR: render.section: Unknown section type: {{ s.type|e }}</strong><br />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment