hugolib: Allow page-relative aliases

Fixes #5757
This commit is contained in:
Bjørn Erik Pedersen
2019-03-30 17:08:25 +01:00
parent a55640de8e
commit 92baa14fd3
7 changed files with 46 additions and 29 deletions

View File

@@ -82,9 +82,13 @@ The following is a list of values that can be used in a `permalink` definition i
## Aliases
For people migrating existing published content to Hugo, there's a good chance you need a mechanism to handle redirecting old URLs.
Aliases can be used to create redirects to your page from other URLs.
Luckily, redirects can be handled easily with **aliases** in Hugo.
Aliases comes in two forms:
1. Starting with a `/` meaning they are relative to the `BaseURL`, e.g. `/posts/my-blogpost/`
2. They are relative to the `Page` they're defined in, e.g. `my-blogpost` or even something like `../blog/my-blogpost` (new in Hugo 0.55).
### Example: Aliases