Not sure if there's another way to do this...
metaDataFormat: "yaml"
disableKinds: ["404", "taxonomy", "term", "RSS"]
+outputFormats:
+ OpenSearch:
+ baseName: opensearch
+ isPlainText: true
+ mediaType: application/xml
+ notAlternative: true
+
+outputs:
+ home:
+ - HTML
+ - OpenSearch
+
publishDir: "_site"
module:
--- /dev/null
+<?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>
+ <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>
<title>{{ if .IsHome }}{{ .Site.Title | markdownify }} · {{ .Site.Params.subtitle | markdownify }}{{ else }}{{ .Title | markdownify }} · {{ .Site.Title | markdownify }} v{{ .Site.Params.docs_version }}{{ end }}</title>
<link rel="canonical" href="{{ .Permalink }}">
-<link rel="search" href="/documentation-search.xml" type="application/opensearchdescription+xml">
+
+{{ with .OutputFormats.Get "opensearch" -}}
+<link rel="search" href="{{ .Permalink }}" title="{{ $.Site.Title }}" type="application/opensearchdescription+xml">
+{{ end -}}
<link rel="preconnect" href="https://AK7KMZKZHQ-dsn.algolia.net" crossorigin>
+++ /dev/null
-<?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>Bootstrap Documentation</ShortName>
- <Description>Search in the latest Bootstrap documentation</Description>
- <Image height="16" width="16" type="image/x-icon">https://deploy-preview-29872--twbs-bootstrap.netlify.com/favicon.ico</Image>
- <Url type="text/html" method="get" template="https://deploy-preview-29872--twbs-bootstrap.netlify.com/docs/4.3/getting-started/introduction/#search={searchTerms}" />
-</OpenSearchDescription>