Commit b3a77d8 1 parent 8a5217e commit b3a77d8 Copy full SHA for b3a77d8
File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,15 @@ const emitExdocLoaded = () => {
10
10
window . dispatchEvent ( new Event ( 'exdoc:loaded' ) )
11
11
}
12
12
13
+ const maybeMetaRedirect = ( visit , { page} ) => {
14
+ const match = page . html . match ( / < m e t a \s + h t t p - e q u i v \s * = \s * [ " ' ] r e f r e s h [ " ' ] \s + c o n t e n t \s * = \s * [ " ' ] \d + \s * ; \s * u r l \s * = \s * ( [ ^ " ' ] + ) [ " ' ] / i)
15
+
16
+ if ( match && match [ 1 ] ) {
17
+ visit . abort ( )
18
+ window . location . href = match [ 1 ]
19
+ }
20
+ }
21
+
13
22
window . addEventListener ( 'DOMContentLoaded' , emitExdocLoaded )
14
23
15
24
if ( ! isEmbedded && window . location . protocol !== 'file:' ) {
@@ -23,6 +32,7 @@ if (!isEmbedded && window.location.protocol !== 'file:') {
23
32
} ,
24
33
linkSelector : 'a[href]:not([href^="/"]):not([href^="http"])' ,
25
34
hooks : {
35
+ 'page:load' : maybeMetaRedirect ,
26
36
'page:view' : emitExdocLoaded
27
37
} ,
28
38
plugins : [ new SwupA11yPlugin ( ) , new SwupProgressPlugin ( { delay : 500 } ) ]
You can’t perform that action at this time.
0 commit comments