This repository was archived by the owner on Aug 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change
1
+ quickNav = ( function ( ) {
2
+
3
+ var baseUrl ;
4
+
1
5
// alias preact's hyperscript reviver since it's referenced a lot:
2
6
var h = preact . h ;
3
7
@@ -256,7 +260,7 @@ var App = createClass({
256
260
257
261
var renderItem = function ( item ) {
258
262
return h ( 'li' , { class : 'search-result' } ,
259
- this . navigationLink ( item . link , { } ,
263
+ this . navigationLink ( baseUrl + "/" + item . link , { } ,
260
264
h ( DocHtml , { html : item . display_html } )
261
265
)
262
266
) ;
@@ -379,4 +383,10 @@ var NoResultsMsg = function(props) {
379
383
return messages [ ( props . searchString || 'a' ) . charCodeAt ( 0 ) % messages . length ] ;
380
384
} ;
381
385
382
- preact . render ( h ( App ) , document . body ) ;
386
+ return {
387
+ init : function ( docBaseUrl ) {
388
+ baseUrl = docBaseUrl || "" ;
389
+ preact . render ( h ( App ) , document . body ) ;
390
+ }
391
+ }
392
+ } ) ( ) ;
Original file line number Diff line number Diff line change @@ -194,7 +194,12 @@ bodyHtml doctitle iface
194
194
195
195
script ! [src jsPreactFile, thetype " text/javascript" ] << noHtml,
196
196
script ! [src jsFuseFile, thetype " text/javascript" ] << noHtml,
197
- script ! [src jsIndexFile, thetype " text/javascript" ] << noHtml
197
+ script ! [src jsIndexFile, thetype " text/javascript" ] << noHtml,
198
+ script ! [thetype " text/javascript" ]
199
+ -- NB: Within XHTML, the content of script tags needs to be
200
+ -- a <![CDATA[ section.
201
+ << primHtml
202
+ " //<![CDATA[\n quickNav.init();\n //]]>\n "
198
203
]
199
204
200
205
moduleInfo :: Interface -> Html
You can’t perform that action at this time.
0 commit comments