File tree Expand file tree Collapse file tree 4 files changed +40
-8
lines changed Expand file tree Collapse file tree 4 files changed +40
-8
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ canonifyURLs: true
5
5
enableGitInfo : true
6
6
disablePathToLower : true
7
7
outputs :
8
- home : ['HTML', 'JSON']
8
+ home : ['HTML', 'JSON', 'OpenSearchXML' ]
9
9
markup :
10
10
goldmark :
11
11
parser :
@@ -14,3 +14,13 @@ markup:
14
14
unsafe : true
15
15
tableOfContents :
16
16
endLevel : 3
17
+ outputFormats :
18
+ OpenSearchXML :
19
+ baseName : search
20
+ isPlainText : true
21
+ mediaType : application/opensearchdescription+xml
22
+ protocol : bep://
23
+ mediaTypes :
24
+ application/opensearchdescription+xml :
25
+ suffixes :
26
+ - xml
Original file line number Diff line number Diff line change
1
+ <OpenSearchDescription xmlns =" http://a9.com/-/spec/opensearch/1.1/"
2
+ xmlns : moz =" http://www.mozilla.org/2006/browser/search/" >
3
+ <ShortName >{{ .Title }}</ShortName >
4
+ <Description >{{ .Title }}</Description >
5
+ <InputEncoding >UTF-8</InputEncoding >
6
+ <Image width =" 16" height =" 16" type =" image/x-icon" >https://contao.org/favicon.ico</Image >
7
+ <Url type =" text/html" method =" get" template =" {{.Permalink}}?search={searchTerms}" />
8
+ </OpenSearchDescription >
Original file line number Diff line number Diff line change 1
1
< script type ="text/javascript " src ="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js "> </ script >
2
- < script type ="text/javascript "> docsearch ( {
3
- apiKey : '532603b4ad01695b68a0f6048dc8ea46' ,
4
- indexName : 'contao' ,
5
- inputSelector : '#algolia-search' ,
6
- algoliaOptions : { 'facetFilters' : [ "language:{{ .Page.Language | default " en " }}" ] } ,
7
- debug : true // Set debug to true if you want to inspect the dropdown
8
- } ) ;
2
+ < script type ="text/javascript "> ( function ( ) {
3
+ var search = docsearch ( {
4
+ apiKey : '532603b4ad01695b68a0f6048dc8ea46' ,
5
+ indexName : 'contao' ,
6
+ inputSelector : '#algolia-search' ,
7
+ algoliaOptions : { 'facetFilters' : [ "language:{{ .Page.Language | default " en " }}" ] } ,
8
+ debug : true // Set debug to true if you want to inspect the dropdown
9
+ } ) ;
10
+ if ( URLSearchParams !== undefined ) {
11
+ var params = new URLSearchParams ( location . search ) ;
12
+ if ( params . has ( 'search' ) ) {
13
+ search . autocomplete . autocomplete . setVal ( params . get ( 'search' ) ) ;
14
+ search . autocomplete . autocomplete . open ( ) ;
15
+ }
16
+ }
17
+ } ) ( ) ;
9
18
</ script >
Original file line number Diff line number Diff line change 12
12
g . async = true ; g . defer = true ; g . src = u + 'matomo.js' ; s . parentNode . insertBefore ( g , s ) ;
13
13
} ) ( ) ;
14
14
</ script >
15
+
16
+ {{ $searchXml := .Site.Home.OutputFormats.Get "opensearchxml" }}
17
+ {{ if ne $searchXml }}
18
+ < link rel ="search " type ="application/opensearchdescription+xml " title ="Search {{ .Site.Title }} " href ="{{ $searchXml.RelPermalink }} ">
19
+ {{ end }}
You can’t perform that action at this time.
0 commit comments