Hi there,
I have an existing monolingual site that I’m adding another language (French) to. I would like only occasional individual single pages to be in that language, and I would like the index page and list pages not to be generated for that language. I’m currently using the file name to translate pages, not a directory.
Specifically:
- Currently,
/fr/
and/fr/posts/
are being generated, with the same content as the default English versions. I don’t want these URLs to be generated — I only want the one translated post I have to be generated at/fr/posts/abc
. - I’d also like the language not to show up in the slug if possible (e.g. no
/fr/posts/abc
, just/posts/abc
. From reading other forum posts I don’t think this is possible, but this would be a nice to have!
My current language config is:
languages:
en:
languageName: English
weight: 1
params:
lang: en
fr:
languageName: Français
weight: 2
params:
lang: fr
disabledKinds: ["home", "section", "taxonomy", "404"]
However, I can still open /fr
/ and /fr/posts
, which I assumed wouldn’t be generated given the disabledKinds
.
I also considered just handling these posts separately with a different template, but I’d like date displays to be localized, and as far as I can tell that’s only possible by setting the page’s language correctly.
Here’s a link to the project if it’s helpful.
Thank you!