{# MIT License Copyright (c) 2021 vuquangtrong Copyright (c) 2021 Liang Yesheng Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #} {% block style %} {% endblock %} {% set page_num = (pages|count / page_size)|round(method='ceil')|int %} {% if page_num == 0 or not paging %} {% set page_num = 1 %} {% if not paging %} {% set page_size = 10000 %} {% endif %} {% endif %}
{% for page_idx in range(0, page_num) %} {% set pg_group = pages[page_idx*page_size:(page_idx + 1)*page_size] %}
{% for pg in pg_group %} {# Setting variables. #} {% set url = pg.canonical_url %} {% set title = pg.title %} {% if pg.meta and pg.meta.title_full %} {% set title = pg.meta.title_full %} {% endif %} {% set description = "" %} {% if pg.meta.description %} {% set description = pg.meta.description|truncate %} {% endif %} {% set time = "" %} {% if pg.meta and pg.meta["localized-time"] %} {% set time = pg.meta["localized-time"] %} {% endif %} {# Render blogs. If a marco is provided, then use the marco to render. #} {% if render_blog is defined %} {% call render_blog(title, description, time, url) %} {% endcall %} {% else %}

{{ title }}

{{ description }}

{{ ("Updated" if is_revision else "Published") + " at: " + time }}

{% endif %} {% endfor %}
{% endfor %}
{% for num in range(page_num) %} {{ num + 1 }} {% endfor %}
{% if show_total %}
Total {{ pages|count }} posts.
{% endif %}