@brillout/docpress 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -553,16 +553,15 @@ function getDocSearchJS(pageContext) {
|
|
|
553
553
|
const docSearchJS = !algolia ? "" : escapeInject(_a || (_a = __template([`
|
|
554
554
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"><\/script>
|
|
555
555
|
<script type="text/javascript">
|
|
556
|
-
const appId = '`, "';\n const apiKey = '", "';\n const indexName = '", "';\n const
|
|
556
|
+
const appId = '`, "';\n const apiKey = '", "';\n const indexName = '", "';\n const transformItems = ", ";\n docsearch({\n container: '#docsearch-desktop',\n appId, apiKey, indexName, transformItems\n });\n docsearch({\n container: '#docsearch-mobile',\n appId, apiKey, indexName, transformItems\n });\n <\/script>\n "])), algolia.appId, algolia.apiKey, algolia.indexName, dangerouslySkipEscape(getTransformItems()));
|
|
557
557
|
return docSearchJS;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function getTransformItems() {
|
|
560
560
|
return `function(hits) {
|
|
561
561
|
hits.map(hit => {
|
|
562
|
-
if (hit.
|
|
563
|
-
hit.url = hit.url.replace('#'
|
|
564
|
-
|
|
565
|
-
}
|
|
562
|
+
if (hit.url.indexOf('#page-content') > 0) {
|
|
563
|
+
hit.url = hit.url.replace('#page-content', '');
|
|
564
|
+
}
|
|
566
565
|
});
|
|
567
566
|
return hits;
|
|
568
567
|
}`;
|
package/package.json
CHANGED