Compare commits
7 commits
main
...
master-mc-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b50f69386 | ||
|
|
19f3b4a2e5 | ||
|
|
c29cd7f770 | ||
|
|
f02783af30 | ||
|
|
648538b5cc | ||
|
|
66c11808b2 | ||
|
|
be0c4e1d30 |
4 changed files with 39 additions and 1 deletions
12
config.yml
12
config.yml
|
|
@ -20,6 +20,18 @@ enableRobotsTXT: true
|
|||
metaDataFormat: "yaml"
|
||||
disableKinds: ["404", "taxonomy", "taxonomyTerm", "RSS"]
|
||||
|
||||
outputFormats:
|
||||
OpenSearch:
|
||||
baseName: opensearch
|
||||
isPlainText: true
|
||||
mediaType: application/xml
|
||||
notAlternative: true
|
||||
|
||||
outputs:
|
||||
home:
|
||||
- HTML
|
||||
- OpenSearch
|
||||
|
||||
publishDir: "_gh_pages"
|
||||
|
||||
module:
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
})
|
||||
|
||||
window.docsearch({
|
||||
var search = window.docsearch({
|
||||
apiKey: '5990ad008512000bba2cf951ccf0332f',
|
||||
indexName: 'bootstrap',
|
||||
inputSelector: '#search-input',
|
||||
|
|
@ -50,4 +50,18 @@
|
|||
// Set debug to `true` if you want to inspect the dropdown
|
||||
debug: false
|
||||
})
|
||||
|
||||
function hashSearch() {
|
||||
var SEARCH_WORD = '#search='
|
||||
|
||||
if (window.location.hash && window.location.hash.startsWith(SEARCH_WORD)) {
|
||||
search.input.autocomplete.setVal(window.location.hash.slice(SEARCH_WORD.length))
|
||||
search.input.autocomplete.open()
|
||||
}
|
||||
}
|
||||
|
||||
hashSearch()
|
||||
|
||||
// For the nerds: search by changing the url hash
|
||||
window.addEventListener('hashchange', hashSearch, false)
|
||||
})()
|
||||
|
|
|
|||
8
site/layouts/_default/list.opensearch.xml
Normal file
8
site/layouts/_default/list.opensearch.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
|
||||
<ShortName>{{ .Site.Title }}</ShortName>
|
||||
<Description>Search {{ .Site.Title }} documentation</Description>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<Image type="image/x-icon" width="16" height="16">{{ (printf "/docs/%s/assets/img/favicons/favicon.ico" .Site.Params.docs_version) | absURL }}</Image>
|
||||
<Url type="text/html" method="get" template="{{ (printf "/docs/%s/getting-started/introduction/" .Site.Params.docs_version) | absURL }}#search={searchTerms}"/>
|
||||
</OpenSearchDescription>
|
||||
|
|
@ -11,6 +11,10 @@
|
|||
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
|
||||
{{ with .OutputFormats.Get "opensearch" -}}
|
||||
<link rel="search" href="{{ .Permalink }}" title="{{ $.Site.Title }}" type="application/opensearchdescription+xml">
|
||||
{{ end -}}
|
||||
|
||||
{{ with .Params.robots -}}
|
||||
<meta name="robots" content="{{ . }}">
|
||||
{{- end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue