xmitter-11ty/en/en.11tydata.js
Zach Leatherman 9acd192d0d Use new html base plugin!
Removes all the url filters
2022-08-19 11:05:22 -05:00

12 lines
424 B
JavaScript

module.exports = {
lang: "en",
permalink: function(data) {
// Change (English) /en/blog/my-post URLs to have an implied language code /blog/my-post URLs instead.
let [slashPrefixEmpty, langCode, ...stem] = data.page.filePathStem.split("/");
let path = stem.join("/");
// Account for `permalink: 404.html` style
return stem[stem.length - 1] === "index" ? `${path}.html` : `${path}/index.html`;
}
}