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) }} {{ marginals::navbar(current_lang=current_lang) }}
</header> </header>
<main> <main>
{%- if page.extra.redirect -%}
<meta http-equiv="Refresh" content="0; url='{{ page.extra.redirect }}'" />
{%- endif -%}
{% block pre_content %} {% block pre_content %}
{% endblock pre_content %} {% endblock pre_content %}
<article> <article>

View file

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