Commit ad37cba5 authored by Stefan Behnel's avatar Stefan Behnel

Only overwrite the href on legacy docs redirects, not the complete URL.

parent c9c2ee2f
......@@ -459,22 +459,14 @@ pdf_fit_background_mode = 'scale'
# Making redirection:
html_template = """
html_template = """\
<html>
<head>
<script>
// Redirect to the new-style URL
var new_location = '{0}'
// Some browsers include the hash character in the anchor, strip it out
const anchor = window.location.hash.replace(/^#(.*)/, '$1');
if (anchor){{
new_location += '#' + anchor;
}}
window.location = new_location
// Redirect to the new-style URL, but keep any #anchor etc.
window.location.href = '{0}';
</script>
<meta http-equiv="refresh" content="1; url={0}:" />
<meta http-equiv="refresh" content="1; url={0}" />
</head>
</html>
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment