Skip to content

Commit cf5ed1c

Browse files
authored
Fix summary of search result for matches in title. Clean up search facet options (#2068)
* Fix summary of search result for matches in title * Clean up search options
1 parent f7a1dbf commit cf5ed1c

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

docs/_static/searchtools.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,20 +253,20 @@ const Search = {
253253
htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() });
254254
}
255255
if (anchor) {
256-
const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`);
256+
const anchorContent = htmlElement.querySelector(`.bd-article ${anchor}`);
257257
if (anchorContent) return anchorContent.textContent;
258258

259259
console.warn(
260-
`Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.`
260+
`Anchored content block not found. Sphinx search tries to obtain it via DOM query '.bd-article ${anchor}'. Check your theme or template.`
261261
);
262262
}
263263

264264
// if anchor not specified or not found, fall back to main content
265-
const docContent = htmlElement.querySelector('[role="main"]');
265+
const docContent = htmlElement.querySelector('.bd-article');
266266
if (docContent) return docContent.textContent;
267267

268268
console.warn(
269-
"Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template."
269+
"Content block not found. Sphinx search tries to obtain it via DOM query '.bd-article'. Check your theme or template."
270270
);
271271
return "";
272272
},

docs/_templates/components/search-field.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,18 @@
2828
['backend', 'Backend'],
2929
['classic-ui', 'Classic UI'],
3030
['conceptual-guides', 'Conceptual Guides'],
31-
['contributing', 'Contributing'],
31+
['contributing', 'Contributing to Plone'],
3232
['deployment', 'Deployment'],
3333
['developer-guide', 'Developer Guide'],
34-
['i18n-l10n', 'i18n/l10n'],
34+
['glossary', 'Glossary'],
35+
['i18n-l10n', 'Internationalization and Localization'],
3536
['install', 'Install'],
3637
['overview', 'Overview'],
3738
['reference-guide', 'Reference Guide'],
38-
['training', 'Training'],
3939
['upgrade', 'Upgrade'],
40-
['user-guide', 'User Guide'],
4140
['plone.restapi', 'Plone REST API'],
4241
['plone.api', 'Plone API'],
43-
['volto', 'Volto'],
42+
['volto', 'Volto UI'],
4443
] %}
4544
<option value="{{id}}">{{ title }}</option>
4645
{% endfor %}

0 commit comments

Comments
 (0)