aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/content-management/urls.md
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2019-04-20 15:19:38 +0200
committerBjørn Erik Pedersen <[email protected]>2019-04-20 15:19:38 +0200
commit0508ca1856e57421fca699c6427cc19531b55b7a (patch)
treedb015657f0268054adff358ebec4b4a329d931a0 /docs/content/en/content-management/urls.md
parentc7dd66bfe2e32430f9b1a3126c67014e40d8405e (diff)
parenta0c28c943c2f4714fa340b22a583b96f5013090b (diff)
downloadhugo-0508ca1856e57421fca699c6427cc19531b55b7a.tar.gz
hugo-0508ca1856e57421fca699c6427cc19531b55b7a.zip
Merge commit 'a0c28c943c2f4714fa340b22a583b96f5013090b'
Diffstat (limited to 'docs/content/en/content-management/urls.md')
-rw-r--r--docs/content/en/content-management/urls.md22
1 files changed, 20 insertions, 2 deletions
diff --git a/docs/content/en/content-management/urls.md b/docs/content/en/content-management/urls.md
index 5ba9e758e..9cb16f52d 100644
--- a/docs/content/en/content-management/urls.md
+++ b/docs/content/en/content-management/urls.md
@@ -84,7 +84,6 @@ The following is a list of values that can be used in a `permalink` definition i
Aliases can be used to create redirects to your page from other URLs.
-
Aliases comes in two forms:
1. Starting with a `/` meaning they are relative to the `BaseURL`, e.g. `/posts/my-blogpost/`
@@ -130,6 +129,8 @@ aliases:
---
```
+From Hugo 0.55 you can also have page-relative aliases, so ` /es/posts/my-original-post/` can be simplified to the more portable `my-original-post/`
+
### How Hugo Aliases Work
When aliases are specified, Hugo creates a directory to match the alias entry. Inside the directory, Hugo creates an `.html` file specifying the canonical URL for the page and the new redirect target.
@@ -257,12 +258,29 @@ Or, if you are on Windows and do not have `grep` installed:
hugo config | FINDSTR /I canon
```
-## Override URLs with Front Matter
+## Set URL in Front Matter
In addition to specifying permalink values in your site configuration for different content sections, Hugo provides even more granular control for individual pieces of content.
Both `slug` and `url` can be defined in individual front matter. For more information on content destinations at build time, see [Content Organization][contentorg].
+From Hugo 0.55, you can use URLs relative to the current site context (the language), which makes it simpler to maintain. For a Japanese translation, both of the following examples would get the same URL:
+
+```markdown
+---
+title: "Custom URL!"
+url: "/jp/custom/foo"
+---
+```
+
+```markdown
+---
+title: "Custom URL!"
+url: "custom/foo"
+---
+```
+
+
## Relative URLs
By default, all relative URLs are left unchanged by Hugo, which can be problematic when you want to make your site browsable from a local file system.