diff options
| author | Jieiku | 2023-08-17 12:16:18 -0700 |
|---|---|---|
| committer | Jieiku | 2023-08-17 12:16:18 -0700 |
| commit | 3e5d8a96e9eae21a799f327cd8a52adb891ebe66 (patch) | |
| tree | 6a1377b5207e4e3555f65ca162014468c64d6985 /templates/index.html | |
| parent | 1d9be812c25508a5dc36afb9e80669b668a47190 (diff) | |
| parent | 0983915e23793c28dd0bee149fd2ec05a7e96a94 (diff) | |
| download | abridge-3e5d8a96e9eae21a799f327cd8a52adb891ebe66.tar.gz abridge-3e5d8a96e9eae21a799f327cd8a52adb891ebe66.tar.bz2 abridge-3e5d8a96e9eae21a799f327cd8a52adb891ebe66.zip | |
resolve merge conflicts
Diffstat (limited to 'templates/index.html')
| -rw-r--r-- | templates/index.html | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/templates/index.html b/templates/index.html index 7c8c45a..ce224c0 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,3 +1,8 @@ +{# +This Page Shows the Posts with a short summary on the index: example.com/ +This Template can also be used as the rendering template for Sections, eg: example.com/blog/ example.com/software/ +#} + {%- extends "base.html" %} {%- block seo %} @@ -54,12 +59,30 @@ {%- endfor %} {{- macros::pagination(paginator=paginator, config=config) }} </div> - {%- set section_item = get_section(path="_index.md") %} {%- 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:]]+)?/$") %} + {%- 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 = 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 = sec ~ "/" %} + {%- endif %} + {%- endif %} + + {%- if lang == config.default_language %} + {%- set section_item = get_section(path=sec ~ "_index.md") %} + {%- else %} + {%- set section_item = get_section(path=sec ~ "_index." ~ lang ~ ".md") %} + {%- endif %} <div class="toc"> <div class="toc-sticky"> - <h1><span class="s75">Recent Posts</span></h1> - {%- for page in section_item.pages | slice(end=config.extra.recent_items) %} + <h1><span class="s70">{%- if lang != config.default_language %}{{ trans(key="Recent_Posts" | safe, lang=lang) }}{% else %}Recent Posts{% endif %}</span></h1> + {%- set recent_items=config.extra.recent_items | default(value=9) -%} + {%- for page in section_item.pages | slice(end=recent_items) %} {{- page_macros::page_listing(page=page, config=config) }} {%- endfor %} </div> |
