Skip to main content

% 16k.es

Hugo Redirect Page

How to create a redirect page in Hugo.

Hugo

Some themes may alredy provide a documented mechanism to create redirect pages. It does not happen with the theme I use (based on Anubis2) so this is what I did.

Create a new template /layouts/redirect/single.html:

{{- template "_internal/alias.html" (dict "Permalink" .Params.target) -}}

and a page with just this content:

---
type: redirect
target: https://<destination_url>
---

And that’s it! I found this solution in this page where you can find a detailed explanation