From 9c17fcb4b70332cf125e95beabaf6aa6cb978e55 Mon Sep 17 00:00:00 2001 From: Ryan Watters Date: Tue, 2 May 2017 11:39:08 -0500 Subject: [PATCH] Update slug translation in multilingual.md Closes rdwatters/hugo-docs-concept#107 --- content/content-management/multilingual.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/content-management/multilingual.md b/content/content-management/multilingual.md index c73d81f51..c594ecfd6 100644 --- a/content/content-management/multilingual.md +++ b/content/content-management/multilingual.md @@ -108,6 +108,15 @@ If left unspecified, the default value for `defaultContentLanguage` is `en`. By having the same *base filename*, the content pieces are linked together as translated pieces. +If you need distinct URLs per language, you can set the slug in the non-default language file. For example, you can define a custom slug for a French translation in the front matter of `content/about.fr.md` as follows: + +```yaml +slug: "a-propos" + +``` + +At render, Hugo will build both `/about/` and `/a-propos/` as properly linked translated pages. + ## Link to Translated Content To create a list of links to translated content, use a template similar to the following: