Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

.redirect Pages #28

Open
gwennlbh opened this issue Nov 29, 2021 · 0 comments
Open

.redirect Pages #28

gwennlbh opened this issue Nov 29, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@gwennlbh
Copy link
Member

gwennlbh commented Nov 29, 2021

Pages that support Go templating and only contain a URL to redirect to. Those files end with .redirect to differentiate them from other pages.

If building a static site with no access to any proper server-side redirection mechanism,
it uses

<meta http-equiv=refresh content="1; url=[[ REDIRECT TO ]]">

<script>window.location = `[[ REDIRECT TO ]]`</script>

in the <head> with an empty body (customizable by putting content in the next lines of the .redirect file, and putting them thru a template defined as sth like redirect.template.{pug,html} ?). [[ REDIRECT TO ]] is replaced with the .redirect file's first line.

See an example of what it would generate (with the customized <body> content mentionned above)

@gwennlbh gwennlbh self-assigned this Nov 29, 2021
@gwennlbh gwennlbh added the enhancement New feature or request label May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant