@apify/docs-theme 1.0.64 → 1.0.66

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.64",
3
+ "version": "1.0.66",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
package/src/config.js CHANGED
@@ -107,7 +107,7 @@ const themeConfig = ({
107
107
  href: 'https://github.com/apify/fingerprint-suite',
108
108
  },
109
109
  {
110
- label: 'See Apify on GitHub',
110
+ label: 'Apify on GitHub',
111
111
  href: 'https://github.com/apify',
112
112
  },
113
113
  ],
@@ -115,7 +115,7 @@ const themeConfig = ({
115
115
  {
116
116
  href: 'https://github.com/apify',
117
117
  label: 'GitHub',
118
- title: 'See Apify on GitHub',
118
+ title: 'Apify on GitHub',
119
119
  position: 'right',
120
120
  className: 'icon',
121
121
  },
@@ -237,6 +237,7 @@ const themeConfig = ({
237
237
  appId: 'N8EOCSBQGH',
238
238
  apiKey: 'b43e67a96ed18c7f63f5fd965906a96d', // search only (public) API key
239
239
  indexName: 'apify_sdk',
240
+ contextualSearch: false,
240
241
  algoliaOptions: {
241
242
  facetFilters: ['version:VERSION'],
242
243
  },
@@ -8,8 +8,8 @@ import NavbarLogo from '@theme/Navbar/Logo';
8
8
  import NavbarItem from '@theme/NavbarItem';
9
9
  import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
10
10
  import NavbarSearch from '@theme/Navbar/Search';
11
- import SearchBar from '@theme/SearchBar';
12
11
  import NavbarMobileSidebarToggle from '@theme/Navbar/MobileSidebar/Toggle';
12
+ import SearchBar from '../../SearchBar';
13
13
  import styles from './styles.module.css';
14
14
 
15
15
  function NavbarItems({ items }) {
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import Head from '@docusaurus/Head';
3
+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
4
+ import { useActiveDocContext } from '@docusaurus/plugin-content-docs/client';
5
+
6
+ export default function SearchMetadata({ locale, version, tag }) {
7
+ const { siteConfig } = useDocusaurusContext();
8
+ const language = locale;
9
+
10
+ // keep the tag on same value for all the content, and add a new section + section tag
11
+ const section = siteConfig.projectName;
12
+ const sectionTag = tag;
13
+ tag = 'default';
14
+
15
+ const docsPluginId = siteConfig.presets[0][1].docs.id ?? 'default';
16
+ const activeDocContext = useActiveDocContext(docsPluginId);
17
+
18
+ // normalize the latest version regardless of what number it has,
19
+ // so we can search across all "latest versions of the docs"
20
+ if (!version || !activeDocContext.activeVersion || activeDocContext.activeVersion.isLast) {
21
+ version = 'latest';
22
+ }
23
+
24
+ return (
25
+ <Head>
26
+ {/*
27
+ Docusaurus metadata, used by third-party search plugin
28
+ See https://github.com/cmfcmf/docusaurus-search-local/issues/99
29
+ */}
30
+ {locale && <meta name="docusaurus_locale" content={locale}/>}
31
+ {version && <meta name="docusaurus_version" content={version}/>}
32
+ {tag && <meta name="docusaurus_tag" content={tag}/>}
33
+
34
+ {/* Algolia DocSearch metadata */}
35
+ {language && <meta name="docsearch:language" content={language}/>}
36
+ {version && <meta name="docsearch:version" content={version}/>}
37
+ <meta name="docsearch:docusaurus_tag" content={tag}/>
38
+ <meta name="docsearch:section" content={section}/>
39
+ <meta name="docsearch:section_tag" content={sectionTag}/>
40
+ </Head>
41
+ );
42
+ }