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