feat: external link redirect

This commit is contained in:
zaaarf 2024-01-19 19:44:44 +01:00
parent e8addb1d70
commit a7b25ca5cc
No known key found for this signature in database
GPG key ID: 102E445F4C3F829B
2 changed files with 15 additions and 6 deletions

View file

@ -17,6 +17,10 @@
{{ marginals::navbar(current_lang=current_lang) }}
</header>
<main>
{%- if page.extra.redirect -%}
<meta http-equiv="Refresh" content="0; url='{{ page.extra.redirect }}'" />
{%- endif -%}
{% block pre_content %}
{% endblock pre_content %}
<article>

View file

@ -5,11 +5,11 @@
{{ section.content | safe }}
{% if paginator %}
{% set pages = paginator.pages %}
{% else %}
{% set pages = section.pages %}
{% endif %}
{%- if paginator -%}
{%- set pages = paginator.pages -%}
{%- else -%}
{% set pages = section.pages -%}
{%- endif -%}
<ul class="title-list">
{%- for page in pages -%}
@ -22,7 +22,12 @@
{%- else -%}
{% set datefmt = " @ %Y-%m-%dT%H:%M:%S%Z" %}
{%- endif -%}
<li><a href="{{ page.permalink | safe }}">{{ page.title }}
{%- if page.extra.redirect -%}
{%- set page_link = page.extra.redirect -%}
{%- else -%}
{%- set page_link = page.permalink -%}
{%- endif -%}
<li><a href="{{ page_link | safe }}">{{ page.title }}
{%- if section.extra.show_subtitle and section.extra.show_subtitle == true and page.extra.subtitle -%}
<span class="content-subtitle"> - {{ page.extra.subtitle }}</span>
{%- endif -%}