mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 12:16:55 +00: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:
1 parent
6f41a0de74
commit
4ae66b63da
2 files changed
+10
No files matched your search
@@ -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