Exclude self from translation list for page/section

Closes #1410
This commit is contained in:
Vincent Prouillet 2021-06-24 23:28:48 +02:00
parent 545e766818
commit 0a7692ad85

View file

@ -33,6 +33,9 @@ impl<'a> TranslatedContent<'a> {
.iter() .iter()
{ {
let other = library.get_section_by_key(*key); let other = library.get_section_by_key(*key);
if other.permalink == section.permalink {
continue;
}
translations.push(TranslatedContent { translations.push(TranslatedContent {
lang: &other.lang, lang: &other.lang,
permalink: &other.permalink, permalink: &other.permalink,
@ -51,6 +54,9 @@ impl<'a> TranslatedContent<'a> {
library.translations.get(&page.file.canonical).or(Some(&HashSet::new())).unwrap().iter() library.translations.get(&page.file.canonical).or(Some(&HashSet::new())).unwrap().iter()
{ {
let other = library.get_page_by_key(*key); let other = library.get_page_by_key(*key);
if other.permalink == page.permalink {
continue;
}
translations.push(TranslatedContent { translations.push(TranslatedContent {
lang: &other.lang, lang: &other.lang,
permalink: &other.permalink, permalink: &other.permalink,