@apify/docs-theme 1.0.66 → 1.0.68

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/docs-theme",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
package/src/config.js CHANGED
@@ -1,5 +1,10 @@
1
1
  /* eslint-disable global-require */
2
- const absoluteUrl = process.env.LOCAL ? 'http://docs.apify.loc' : 'https://docs.apify.com';
2
+ // eslint-disable-next-line no-nested-ternary
3
+ const absoluteUrl = process.env.LOCALHOST
4
+ ? 'http://localhost:3000'
5
+ : process.env.DEV
6
+ ? 'http://docs.apify.loc'
7
+ : 'https://docs.apify.com';
3
8
 
4
9
  const themeConfig = ({
5
10
  docs: {
@@ -237,7 +242,6 @@ const themeConfig = ({
237
242
  appId: 'N8EOCSBQGH',
238
243
  apiKey: 'b43e67a96ed18c7f63f5fd965906a96d', // search only (public) API key
239
244
  indexName: 'apify_sdk',
240
- contextualSearch: false,
241
245
  algoliaOptions: {
242
246
  facetFilters: ['version:VERSION'],
243
247
  },
@@ -56,6 +56,9 @@ function DocSearch({ contextualSearch, externalUrlRegex, ...props }) {
56
56
  mergeFacetFilters(contextualSearchFacetFilters, configFacetFilters)
57
57
  : // ... or use config facetFilters
58
58
  configFacetFilters;
59
+ const tags = facetFilters[facetFilters.length - 1];
60
+ const version = tags[tags.length - 1].match(/-([^-]+)$/)?.[1];
61
+ tags.push(`docusaurus_tag:default-${version}`);
59
62
  // We let user override default searchParameters if she wants to
60
63
  const searchParameters = {
61
64
  ...props.searchParameters,
@@ -10,8 +10,6 @@ export default function SearchMetadata({ locale, version, tag }) {
10
10
  // keep the tag on same value for all the content, and add a new section + section tag
11
11
  const section = siteConfig.projectName;
12
12
  const sectionTag = tag;
13
- tag = 'default';
14
-
15
13
  const docsPluginId = siteConfig.presets[0][1].docs.id ?? 'default';
16
14
  const activeDocContext = useActiveDocContext(docsPluginId);
17
15
 
@@ -21,6 +19,8 @@ export default function SearchMetadata({ locale, version, tag }) {
21
19
  version = 'latest';
22
20
  }
23
21
 
22
+ tag = `default-${version}`;
23
+
24
24
  return (
25
25
  <Head>
26
26
  {/*