lvl0-website/themes/linkita/templates/partials/page_list.html

76 lines
3.3 KiB
HTML
Raw Permalink Normal View History

2025-07-10 20:07:36 +02:00
<!-- Page List -->
{%- set hellip = m_i18n::tr(key=`hellip`, lk=g_lang_k, d=g_trans_d) %}
{%- for page in paginator.pages | default(value=(section.pages | default(value=term.pages))) %}
<section
class="block-bg relative mb-4 rounded-lg p-4 first-of-type:mt-0 last-of-type:mb-0 active:scale-95 lg:mb-6 lg:p-6"
>
{%- if page.extra.cover.image %}
<figure class="mb-4 mt-0">
<img
class="h-auto w-full rounded-lg"
{%- set cover_image = m_url::cover_image(path=page.extra.cover.image, assets=page.assets) %}
{%- if cover_image %}
src="{{ m_url::rel(there=get_url(path=(cover_image | trim_start_matches(pat=`/`)), lang=lang), here=g_here, base=g_base) }}"
{%- else %}
src="{{ m_url::rel(there=get_url(path=page.extra.cover.image), here=g_here, base=g_base) }}"
{%- endif %}
{%- if page.extra.cover.alt is defined %}
alt="{{ page.extra.cover.alt | escape_xml | safe }}"{% endif %}
{%- if page.extra.cover.width is defined %}
width="{{ page.extra.cover.width | int }}"{% endif %}
{%- if page.extra.cover.height is defined %}
height="{{ page.extra.cover.height | int }}"{% endif %}
/>
</figure>
{%- endif %}
<h2 class="!my-0 pb-1 font-bold !leading-none">{{ page.title }}</h2>
{%- if not page.summary %}
{%- set use_summary = false %}
{%- elif not page.description %}
{%- set use_summary = true %}
{%- elif page.extra.page_summary_on_paginator is defined %}
{%- set use_summary = page.extra.page_summary_on_paginator %}
{%- elif section.extra.page_summary_on_paginator is defined %}
{%- set use_summary = section.extra.page_summary_on_paginator %}
{%- elif config.extra.page_summary_on_paginator is defined %}
{%- set use_summary = config.extra.page_summary_on_paginator %}
{%- else %}
{%- set use_summary = false %}
{%- endif %}
{%- if use_summary %}
<div class="not-prose my-1">
{{ page.summary | striptags | trim_end | trim_end_matches(pat=`&hellip;`) | trim_end_matches(pat=`.`) | safe }}{{ hellip | safe }}
</div>
{%- elif page.description %}
<div class="not-prose my-1 truncate">
<p>{{ page.description }}</p>
</div>
{%- else %}
<div class="my-1 truncate"></div>
{%- endif %}
{% include "partials/page_info.html" %}
{#- {% if use_summary %}#continue-reading{% endif %} #}
<a class="absolute inset-0 text-[0]" href="{{ m_url::rel(there=page.permalink, here=g_here, base=g_base) }}">{{ page.title }}</a>
</section>
{%- endfor %}
{%- if paginator is defined %}
<nav class="mt-16 flex">
{%- if paginator.previous %}
<a
class="rounded-full bg-black px-4 py-3 text-sm text-white no-underline shadow duration-75 active:scale-95 dark:bg-white/80 dark:text-black"
href="{{ m_url::rel(there=paginator.previous, here=g_here, base=g_base) }}" rel="prev" accesskey=","
>&#8249; {{ m_i18n::tr(key=`word_prev_page`, lk=g_lang_k, d=g_trans_d) }}</a>
{%- endif %}
{%- if paginator.next %}
<a
class="ml-auto rounded-full bg-black px-4 py-3 text-sm text-white no-underline shadow duration-75 active:scale-95 dark:bg-white/80 dark:text-black"
href="{{ m_url::rel(there=paginator.next, here=g_here, base=g_base) }}" rel="next" accesskey="."
>{{ m_i18n::tr(key=`word_next_page`, lk=g_lang_k, d=g_trans_d) }} &#8250;</a>
{%- endif %}
</nav>
{%- endif %}