From 9aa81efa609f992de7ce0aad2d5e132b194b7408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilhem=20Faur=C3=A9?= Date: Fri, 16 Jun 2023 15:54:18 +0200 Subject: [PATCH] fix : set translationKey to self id if id_trad = 0 --- spip2md/extended_models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spip2md/extended_models.py b/spip2md/extended_models.py index bb4dd4f..6a0f3bf 100644 --- a/spip2md/extended_models.py +++ b/spip2md/extended_models.py @@ -354,8 +354,6 @@ class SpipRedactional(SpipWritable): ) if change_lang: self.lang = forced_lang # So write-all will not be cancelled - if self.id_trad == 0: # Assign translation key to id for Hugo - self.id_trad = self._id # Replace the mutli blocks with the text in the proper lang text = text.replace(block.group(), lang.group(1)) if lang is None: @@ -572,7 +570,7 @@ class SpipRedactional(SpipWritable): # LOG.debug(f"Write frontmatter of `{self._title}`") meta: dict[str, Any] = { "lang": self.lang, - "translationKey": self.id_trad, + "translationKey": self.id_trad if self.id_trad != 0 else self._id, "title": self._url_title, "publishDate": self.date, "lastmod": self.maj,