@apify/docs-theme 1.0.76 → 1.0.78
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 +1 -1
- package/src/config.js +2 -2
- package/src/theme/SearchPage/index.js +15 -11
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -78,7 +78,7 @@ const themeConfig = ({
|
|
|
78
78
|
rel: 'dofollow',
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
|
-
html: 'SDK for Python
|
|
81
|
+
html: 'SDK for Python',
|
|
82
82
|
href: `${absoluteUrl}/sdk/python/`, // we need a trailing slash here, we'd get redirected there anyway
|
|
83
83
|
target: '_self',
|
|
84
84
|
rel: 'dofollow',
|
|
@@ -198,7 +198,7 @@ const themeConfig = ({
|
|
|
198
198
|
rel: 'dofollow',
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
|
-
label: 'SDK for Python
|
|
201
|
+
label: 'SDK for Python',
|
|
202
202
|
href: `${absoluteUrl}/sdk/python/`, // we need a trailing slash here, we'd get redirected there anyway
|
|
203
203
|
target: '_self',
|
|
204
204
|
rel: 'dofollow',
|
|
@@ -55,7 +55,10 @@ function useDocsSearchVersionsHelpers() {
|
|
|
55
55
|
),
|
|
56
56
|
);
|
|
57
57
|
// Set the value of a single select menu
|
|
58
|
-
const setSearchVersion = (pluginId, searchVersion) => setSearchVersions((s) => ({
|
|
58
|
+
const setSearchVersion = (pluginId, searchVersion) => setSearchVersions((s) => ({
|
|
59
|
+
...s,
|
|
60
|
+
[pluginId]: searchVersion,
|
|
61
|
+
}));
|
|
59
62
|
const versioningEnabled = Object.values(allDocsData).some(
|
|
60
63
|
(docsData) => docsData.versions.length > 1,
|
|
61
64
|
);
|
|
@@ -109,9 +112,7 @@ function SearchVersionSelectList({ docsSearchVersionsHelpers }) {
|
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
function SearchPageContent() {
|
|
112
|
-
const {
|
|
113
|
-
i18n: { currentLocale },
|
|
114
|
-
} = useDocusaurusContext();
|
|
115
|
+
const { siteConfig, i18n: { currentLocale } } = useDocusaurusContext();
|
|
115
116
|
const {
|
|
116
117
|
algolia: { appId, apiKey, indexName },
|
|
117
118
|
} = useAlgoliaThemeConfig();
|
|
@@ -183,15 +184,18 @@ function SearchPageContent() {
|
|
|
183
184
|
);
|
|
184
185
|
const items = hits.map(
|
|
185
186
|
({
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
url,
|
|
188
|
+
_highlightResult: { hierarchy },
|
|
189
|
+
_snippetResult: snippet = {},
|
|
190
|
+
}) => {
|
|
191
|
+
if (url.startsWith(siteConfig.url)) {
|
|
192
|
+
url = url.substring(siteConfig.url.length);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const titles = Object.keys(hierarchy).map((key) => sanitizeValue(hierarchy[key].value));
|
|
192
196
|
return {
|
|
193
197
|
title: titles.pop(),
|
|
194
|
-
url
|
|
198
|
+
url,
|
|
195
199
|
summary: snippet.content
|
|
196
200
|
? `${sanitizeValue(snippet.content.value)}...`
|
|
197
201
|
: '',
|