@apify/docs-theme 1.0.65 → 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
package/src/config.js
CHANGED
|
@@ -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
|
+
}
|