Skip to content

Commit

Permalink
Fix #2920
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Nov 7, 2023
1 parent fa75a60 commit 0abeebf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Plugins/I18nPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ function getLocaleUrlsMap(urlToInputPath, extensionMap) {
let url = entry.url;
if (!urlMap[url]) {
urlMap[url] = filemap[filepath].filter((entry) => {
if (entry.lang) {
return true;
}
return entry.url !== url;
});
}
Expand Down Expand Up @@ -279,7 +282,9 @@ function EleventyPlugin(eleventyConfig, opts = {}) {
// Find the links that are localized alternates to the inputPath argument
eleventyConfig.addFilter(options.filters.links, function (urlOverride) {
let url = urlOverride || this.page?.url;
return contentMaps.localeUrlsMap[url] || [];
return (contentMaps.localeUrlsMap[url] || []).filter((entry) => {
return entry.url !== url;
});
});

// Returns a `page`-esque variable for the root default language page
Expand Down

0 comments on commit 0abeebf

Please sign in to comment.