diff --git a/src/templates/article_translation.html b/src/templates/article_translation.html index c98dbe4..0c7d017 100644 --- a/src/templates/article_translation.html +++ b/src/templates/article_translation.html @@ -30,39 +30,11 @@ - {% if linked|length %} + {% if related|length %} - {% for c in linked %} - - - - - {{c.title}} - - - {{c.preview}} - - - - - - - - {% endfor %} - - - - {% endif %} - - {% if children|length %} - - - - {% for c in children %} + {% for c in related %} diff --git a/stsg/build.py b/stsg/build.py index 41bef70..74e89e1 100644 --- a/stsg/build.py +++ b/stsg/build.py @@ -179,6 +179,7 @@ class ArticleTranslation: ] self.linked_context = self.context["linked"] = [] + self.related_context = self.context["related"] = [] def __init_content_context__(self): template = jinja2.Template(self.html_content) @@ -197,6 +198,9 @@ class ArticleTranslation: if self.language_code in a.article_translations_map: self.linked_context.append(a.article_translations_map[self.language_code].context) + self.related_context.extend(self.linked_context) + self.related_context.extend(self.context["children"]) + self.context["content"] = self.html_content self.context["preview"] = get_preview_text(html_string=self.html_content)
{{c.title}}
- {{c.preview}} -