diff --git a/blog/templates/edition-1/index.html b/blog/templates/edition-1/index.html index 31d4aae7..0d8a68ab 100644 --- a/blog/templates/edition-1/index.html +++ b/blog/templates/edition-1/index.html @@ -1,6 +1,6 @@ {% extends "edition-1/base.html" %} -{% import "macros.html" as macros %} +{% import "edition-1/macros.html" as macros %} {% block title %}{{ config.title }}{% endblock title %} diff --git a/blog/templates/edition-1/macros.html b/blog/templates/edition-1/macros.html new file mode 100644 index 00000000..a6197dad --- /dev/null +++ b/blog/templates/edition-1/macros.html @@ -0,0 +1,39 @@ +{% macro post_link(page) %} + {% set translations = page.translations | filter(attribute="lang", value=lang) -%} + {%- if translations -%} + {%- set post = get_page(path = translations.0.path) -%} + {%- else -%} + {%- set post = page -%} + {%- set not_translated = true -%} + {%- endif -%} +