When redirecting preserve anchors
This commit is contained in:
parent
624991b9b7
commit
d98c2f89aa
@ -46,9 +46,9 @@ def remove_markup(text: str) -> str:
|
|||||||
def sub(m: Match) -> str:
|
def sub(m: Match) -> str:
|
||||||
if m.group(1) == 'ref':
|
if m.group(1) == 'ref':
|
||||||
return {
|
return {
|
||||||
'layouts': f'{base}/overview.html#layouts',
|
'layouts': f'{base}/overview/#layouts',
|
||||||
'sessions': f'{base}/overview.html#sessions',
|
'sessions': f'{base}/overview/#sessions',
|
||||||
'functional': f'{base}/keyboard-protocol.html#functional-key-definitions',
|
'functional': f'{base}/keyboard-protocol/#functional-key-definitions',
|
||||||
}[m.group(2)]
|
}[m.group(2)]
|
||||||
return str(m.group(2))
|
return str(m.group(2))
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,12 @@ def add_old_redirects(loc: str) -> None:
|
|||||||
<head>
|
<head>
|
||||||
<title>Redirecting...</title>
|
<title>Redirecting...</title>
|
||||||
<link rel="canonical" href="{bname}/" />
|
<link rel="canonical" href="{bname}/" />
|
||||||
|
<noscript>
|
||||||
<meta http-equiv="refresh" content="0;url={bname}/" />
|
<meta http-equiv="refresh" content="0;url={bname}/" />
|
||||||
|
</noscript>
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.location.replace('./{bname}/' + window.location.hash);
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>Redirecting, please wait...</p>
|
<p>Redirecting, please wait...</p>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user