12 lines
425 B
JavaScript
12 lines
425 B
JavaScript
|
module.exports = {
|
||
|
lang: "fr",
|
||
|
permalink: function(data) {
|
||
|
// Change (Francais) /fr/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`;
|
||
|
}
|
||
|
}
|