moonlight-stream / moonlight-stream.github.io

Moonlight Stream webpage
https://moonlight-stream.org
Other
49 stars 14 forks source link

#enhancement Add redirect links for documentation #16

Open jorys-paulin opened 5 years ago

jorys-paulin commented 5 years ago

Currently, all links shown to the user redirecting them to the GitHub wiki are direct links, meaning if the wiki link changes, the user will get a 404 if they don't have an updated version of Moonlight with the new, working link.

Adding redirect links to moonlight-stream.org can allow maintainers to have a permalink whose redirect target can be changed if the wiki moves to another domain or URL without changing all corresponding links in all Moonlight versions.

Here's an example. Instead of showing: https://github.com/moonlight-stream/moonlight-docs/wiki/Setup-Guide#streaming-over-the-internet, the link would be like https://moonlight-stream.org/docs/setup#internet, making the link shorter and allowing the target URL to change in the future.

Apart from redirecting, the redirecting pages could in the future be switched to static pages, if for example, the wiki moves from GitHub wiki to this repository, though it's only a possibility.

How to implement this is quite simple, even for GitHub pages, which is only a static server: for each link, let's say /docs/setup, we create setup.html inside the docs directory, containing the following:

<!--Insert basic HTML structure here-->

<!--This will show a fallback link if javascript isn't enabled-->
Redirecting you. If this doesn't work, <a href="https://github.com/moonlight-stream/moonlight-docs/wiki/Setup-Guide">click here</a>
<script>
  // This will ask the browser to redirect the user to that page, and remove this one from browsing history
  window.location.replace("https://github.com/moonlight-stream/moonlight-docs/wiki/Setup-Guide");
</script>

<!--Insert basic HTML structure here-->

I think this will benifit the project in the long run, but before making a pull request I wanted to know if you have anything to say about it, or more ideas.