added link context
This commit is contained in:
parent
f84fb65aa7
commit
f02d37a6af
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## Sunt aevis
|
## Sunt aevis
|
||||||
|
|
||||||
|
{{example.link}}
|
||||||
|
|
||||||
Lorem markdownum turbavere prisca Aeacidae morando esse. Quam Styga spectata,
|
Lorem markdownum turbavere prisca Aeacidae morando esse. Quam Styga spectata,
|
||||||
pariter Iove iunctis exercere Solis? Atlantis possit succurrere quam!
|
pariter Iove iunctis exercere Solis? Atlantis possit succurrere quam!
|
||||||
|
|
||||||
|
@ -130,6 +130,13 @@ class LanguageDict(dict):
|
|||||||
LANGUAGES = LanguageDict()
|
LANGUAGES = LanguageDict()
|
||||||
|
|
||||||
|
|
||||||
|
def compile_cross_article_context(cross_article_context):
|
||||||
|
title = cross_article_context["title"]
|
||||||
|
url = cross_article_context["url"]
|
||||||
|
|
||||||
|
cross_article_context["link"] = f'<a href="{url}">{title}</a>'
|
||||||
|
|
||||||
|
|
||||||
class ArticleTranslation:
|
class ArticleTranslation:
|
||||||
def __init__(self, file: Path, article: Article):
|
def __init__(self, file: Path, article: Article):
|
||||||
self.file = file
|
self.file = file
|
||||||
@ -163,6 +170,7 @@ class ArticleTranslation:
|
|||||||
self.cross_article_context["title"] = self.context["title"]
|
self.cross_article_context["title"] = self.context["title"]
|
||||||
self.cross_article_context["article_url"] = self.article.url
|
self.cross_article_context["article_url"] = self.article.url
|
||||||
self.cross_article_context["url"] = self.url
|
self.cross_article_context["url"] = self.url
|
||||||
|
compile_cross_article_context(self.cross_article_context)
|
||||||
|
|
||||||
# get children
|
# get children
|
||||||
self.context["children"] = [
|
self.context["children"] = [
|
||||||
@ -251,7 +259,7 @@ class Article:
|
|||||||
self.cross_article_context.update(self.context_shared)
|
self.cross_article_context.update(self.context_shared)
|
||||||
self.cross_article_context["title"] = self.context_shared["slug"]
|
self.cross_article_context["title"] = self.context_shared["slug"]
|
||||||
self.cross_article_context["article_url"] = self.context_shared["url"]
|
self.cross_article_context["article_url"] = self.context_shared["url"]
|
||||||
|
compile_cross_article_context(self.cross_article_context)
|
||||||
|
|
||||||
# recursive context structures
|
# recursive context structures
|
||||||
translation_list = self.context["translations"] = []
|
translation_list = self.context["translations"] = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user