mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Implement support for alias templates
This change adds a canonical alias.html template that is used for page redirects, and passes the page as data to the template under .Page Fixes #2533 Closes #2576
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
8b43d39ef3
commit
10a773cde7
@@ -94,3 +94,11 @@ Assuming a baseurl of `mysite.tld`, the contents of the html file will look some
|
||||
```
|
||||
|
||||
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case.
|
||||
|
||||
## Customizing
|
||||
|
||||
You may customize this alias page by creating an alias.html template in the
|
||||
layouts folder of your site. In this case, the data passed to the template is
|
||||
|
||||
* Permalink - the link to the page being aliased
|
||||
* Page - the Page data for the page being aliased
|
@@ -71,4 +71,6 @@ Used to render the XML sitemap
|
||||
### [404](/templates/404/)
|
||||
This template will create a 404.html page used when hosting on GitHub Pages
|
||||
|
||||
### [Alias](/extras/aliases/#customizing)
|
||||
This template will override the default page used to create aliases of pages.
|
||||
|
||||
|
Reference in New Issue
Block a user