From c2d72e09747a2a4abe9602e1ba49a1b4649c9d3c Mon Sep 17 00:00:00 2001
From: Jieiku
Date: Fri, 14 Aug 2026 15:10:15 -0700
Subject: Update for Zola 0.23.3
---
templates/index.html | 74 +++++++++++++++++++++++++---------------------------
1 file changed, 35 insertions(+), 39 deletions(-)
(limited to 'templates/index.html')
diff --git a/templates/index.html b/templates/index.html
index e5da411..3c2c1b1 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -2,44 +2,40 @@
This Template Shows a paginated page of the Posts of a section with a short summary.
This Template can also be used directly for the index eg: example.com/ or as the rendering template for Sections, eg: example.com/blog/ example.com/software/
#}
-
{%- extends "base.html" %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
-{%- block seo %}
- {{- super() }}
-
- {%- if config.title %}
- {%- set title = config.title %}
- {%- else %}
- {%- set title = "" %}
- {%- endif %}
-
- {%- if config.extra.title_addition and title %}
- {%- set title_addition = title_separator ~ config.extra.title_addition %}
- {%- elif config.extra.title_addition %}
- {%- set title_addition = config.extra.title_addition %}
- {%- else %}
- {%- set title_addition = "" %}
- {%- endif %}
-
- {%- set description = config.description %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
-{%- endblock seo %}
+{%- block seo -%}
+ {{- super() -}}
+ {%- if config.title -%}
+ {%- set title = config.title -%}
+ {%- else -%}
+ {%- set title = "" -%}
+ {%- endif -%}
+ {%- if config.extra.title_addition and title -%}
+ {%- set title_addition = title_separator ~ config.extra.title_addition -%}
+ {%- elif config.extra.title_addition -%}
+ {%- set title_addition = config.extra.title_addition -%}
+ {%- else -%}
+ {%- set title_addition = "" -%}
+ {%- endif -%}
+ {%- set description = config.description -%}
+ {{}}
+{%- endblock seo -%}
{%- block content %}
- {%- for page in paginator.pages %}
+ {%- set pages = paginator.pages if paginator else section.pages %}
+ {% for page in pages %}
- {{- macros::title_index(page=page, config=config) }}
- {%- if config.extra.meta_index.position %}
- {%- if config.extra.meta_index.position == "top" or config.extra.meta_index.position == "both" %}
- {{- macros::meta_index(page=page, config=config) }}
+ {{}}
+ {%- if config.extra.meta_index?.position %}
+ {%- if config.extra.meta_index?.position == "top" or config.extra.meta_index?.position == "both" %}
+ {{}}
{%- endif %}{%- endif %}
- {%- if config.extra.meta_index.position %}
- {%- if config.extra.meta_index.position == "bottom" or config.extra.meta_index.position == "both" %}
- {{- macros::meta_index(page=page, config=config) }}
+ {%- if config.extra.meta_index?.position %}
+ {%- if config.extra.meta_index?.position == "bottom" or config.extra.meta_index?.position == "both" %}
+ {{}}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if config.extra.arrow_pagination %}
- {{- macros::pagination(paginator=paginator, config=config) }}
+ {%- if paginator %}{{
}}{% endif %}
{%- else %}
- {{- macros::numpagination(paginator=paginator, config=config) }}
+ {%- if paginator %}{{
}}{% endif %}
{%- endif %}
{%- if config.extra.recent | default(value=true) %}
{#- The following line is checking if the template is being used for the root or a section #}
- {%- if current_path is matching("^(/[[:alpha:]][[:alpha:]])?(/page/[[:digit:]]+)?/$") %}
+ {%- if current_path is matching(pat="^(/[[:alpha:]][[:alpha:]])?(/page/[[:digit:]]+)?/$") %}
{%- set sec = "" %}
{%- else %}
{%- if lang == config.default_language %}
- {%- set sec = current_path | trim_start_matches(pat="/") | split(pat="/page/") | slice(end=1) | join(sep="") | trim_end_matches(pat="/") %}
+ {%- set sec = current_path | trim_start(pat="/") | split(pat="/page/") | first | trim_end(pat="/") %}
{%- set sec = sec ~ "/" %}
{%- else %}
- {%- set sec = current_path | trim_start_matches(pat="/" ~ lang ~ "/") | split(pat="/page/") | slice(end=1) | join(sep="") | trim_end_matches(pat="/") %}
+ {%- set sec = current_path | trim_start(pat="/" ~ lang ~ "/") | split(pat="/page/") | first | trim_end(pat="/") %}
{%- set sec = sec ~ "/" %}
{%- endif %}
{%- endif %}
@@ -90,10 +86,10 @@ This Template can also be used directly for the index eg: example.com/ or as the
{%- endif %}
-
{{ macros::translate(key="Recent", default="Recent", i18n=i18n) }}
+
{{}}
{%- set recent_items=config.extra.recent_items | default(value=9) -%}
- {%- for page in section_item.pages | slice(end=recent_items) %}
- {{- macros::page_listing(page=page, config=config) }}
+ {%- for page in section_item.pages[:recent_items] -%}
+ {{
}}
{%- endfor %}
--
cgit v1.3.1