From 4ae66b63daf4589d373c8f732281e99e4e944d39 Mon Sep 17 00:00:00 2001 From: Nate Finch Date: Sat, 15 Oct 2016 07:35:32 -0400 Subject: [PATCH] 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 --- content/extras/aliases.md | 8 ++++++++ content/templates/overview.md | 2 ++ 2 files changed, 10 insertions(+) diff --git a/content/extras/aliases.md b/content/extras/aliases.md index 9d20e12ba..da861387c 100644 --- a/content/extras/aliases.md +++ b/content/extras/aliases.md @@ -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 \ No newline at end of file diff --git a/content/templates/overview.md b/content/templates/overview.md index 99eb00432..3b41a6641 100644 --- a/content/templates/overview.md +++ b/content/templates/overview.md @@ -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.