@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 transformData = ", ";\n docsearch({\n container: '#docsearch-desktop',\n appId, apiKey, indexName, transformData\n });\n docsearch({\n container: '#docsearch-mobile',\n appId, apiKey, indexName, transformData\n });\n <\/script>\n "])), algolia.appId, algolia.apiKey, algolia.indexName, dangerouslySkipEscape(getTransformData()));
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 getTransformData() {
559
+ function getTransformItems() {
560
560
  return `function(hits) {
561
561
  hits.map(hit => {
562
- if (hit.anchor === 'page-content') {
563
- hit.url = hit.url.replace('#'+ hit.anchor, '');
564
- hit.anchor = null;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "exports": {
5
5
  "./renderer/_default.page.server.js": "./dist/renderer/_default.page.server.js",
6
6
  "./renderer/_default.page.client.js": "./dist/renderer/_default.page.client.js",