Is it possible to translate the path of a section? I’ve this situation:
de is my default language. Currently the German page is available via /imprint and the English one is /en/imprint. Is it possible to override the url of the German page to /impressum?
I figured it out. I just don’t use _index.xy.md files but imprint.xy.md in the content root. Then I could override the url with the frontmatter parameter url. Maybe it should be somewhere documented, that some frontmatter params have no affect in frontmatter.
I understand that _index.html pages are not used for single pages. What I tried is to rename the section from the _index.html file for a certain language. I’ve found in the documentation, that it’s possible to override the URL or parts of it with some frontmatter parameters.
For example I wanted, that the German version of the imprint page is accessible via /impressum, so I added url = /impressum to the frontmatter in _index.de.md. Surprisingly this didn’t have any effect. I was searching the documentation, if this is because it’s an _index page, but I didn’t find anything.
I have the same issue. There is no way to translate the section name (taken from directory name in the filesystem) to another language in a multilingual mode. Neither slug nor url in the frontmatter work.
I have content/news/_index.md and content/news/_index.ru.md which define a section for news posts. Default section name is news for both languages, despite slug: новости or url: новости in the _index.ru.md frontmatter.
I get stuck with this issue with Japanese. My solution so far has been to use the permalinks setting in my config.yaml to fix the subpages, and then put a fairly ugly workaround with another, custom config param into all my shortcodes/partials that generate links, and use Netlify rewrite rules to make the translated links serve the untranslated page.
So, all the links (from menus in particular, which I use to do multilingual cross references) except for .Translation links (which I just can’t fix) are to my desired URL and when it’s navigated to, Netlify serves the original page on that preferred URL with a 200 response.
How to change the url of a section using translations in the title?
I suppose current sections/folders were designed a long time before the multilanguage feature. Newly added _index.md logically fits into customizing /section/ behavior, and slug/url frontmatter support seems natural.
If it’s impossible to translate section’s url, what are other possible workarounds with a similar behavior (e.g. listing all pages in a section, easy menu support, etc.)? Looks like many people are interested in it, including me (also github issue and other topic on the forum Override section url - #5 by felixdb)
I keep my folder names in my primary language and overwrite the url of other language files via url: in frontmatter. not nice to maintain, but actually the quickest solution.
Exactly. I don’t understand when someone does not see the value in something obvious. And this not even matter if someone things it is important; such thing is really easy to add, its just matter of the will at the end.