From 3fa855267ece6162c21aec42e547591610720730 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Fri, 15 Jul 2022 18:00:55 +0200 Subject: [PATCH] Ensure homepages get their translations filled --- CHANGELOG.md | 1 + components/site/src/lib.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c52a72c..9b4defa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ any pages related to that taxonomy - Add `title_bytes` sorting method - Add `insert_anchor = "heading"`, which allows users to use the entire heading as a link - Apply orientation transformation based on EXIF data +- Fix generated homepages not having their `translations` filled properly ## 0.15.3 (2022-01-23) diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index e647f449..788d46a5 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -365,11 +365,13 @@ impl Site { let filename = format!("_index.{}.md", l); index_section.file.path = self.content_path.join(&filename); index_section.file.relative = filename; + index_section.file.canonical = self.content_path.join(format!("_index.{}", l)); } else { index_section.file.name = "_index".to_string(); index_section.permalink = self.config.make_permalink(""); index_section.file.path = self.content_path.join("_index.md"); index_section.file.relative = "_index.md".to_string(); + index_section.file.canonical = self.content_path.join("_index"); index_section.path = "/".to_string(); } index_section.lang = index_section.file.find_language(