kopia lustrzana https://github.com/inkstitch/inkstitch
32 wiersze
1.4 KiB
Plaintext
32 wiersze
1.4 KiB
Plaintext
{%- if page.lang != 'en' -%}
|
|
{%- assign en_page_exists = false -%}
|
|
{%- assign page_lang = page.lang | prepend: '/' | append: '/' -%}
|
|
{%- unless page.is_post == true -%}
|
|
{%- assign en_url = page.url | replace: page_lang, '/' -%}
|
|
{%- if page.is_page -%}
|
|
{%- assign en_page = site.pages | where: "permalink", en_url -%}
|
|
{%- if en_page.size > 0 -%}
|
|
{%- assign en_page_exists = true -%}
|
|
{%- endif -%}
|
|
{%- else -%}
|
|
{%- for collection in site.collections -%}
|
|
{%- assign en_page = collection.docs | where: "permalink", en_url -%}
|
|
{%- if en_page.size > 0 -%}
|
|
{%- assign en_page_exists = true -%}
|
|
{%- break -%}
|
|
{%- endif -%}
|
|
{%- endfor -%}
|
|
{%- endif -%}
|
|
|
|
{%- if en_page_exists == false -%}
|
|
<p class="notice--warning"><b>⚠</b> This page is outdated. For more recent information have a look at the <a href="/">english section</a>.</p>
|
|
{%- else -%}
|
|
{%- assign en_date = en_page.first.last_modified_at | date: "%Y-%m-%d" -%}
|
|
{%- assign page_date = page.last_modified_at | date: "%Y-%m-%d" -%}
|
|
{%- if en_date > page_date -%}
|
|
<p class="notice--warning"><b>⚠</b> This page is outdated. For more recent information have a look at the <a href="{{en_url}}">english original</a>.</p>
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
{%- endunless -%}
|
|
{%- endif -%}
|