Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef6b9d3
commit 19727da
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .backreftranslate import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from pelican import signals | ||
|
||
|
||
def get_article_translations(article_generator): | ||
for article in article_generator.articles: | ||
for translation in article.translations: | ||
translation.is_translation_of = article | ||
|
||
|
||
def get_page_translations(page_generator): | ||
for page in page_generator.pages: | ||
for translation in page.translations: | ||
translation.is_translation_of = page | ||
|
||
|
||
def register(): | ||
signals.article_generator_finalized.connect(get_article_translations) | ||
signals.page_generator_finalized.connect(get_page_translations) |