Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,20 @@ const Search = {
htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() });
}
if (anchor) {
const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`);
const anchorContent = htmlElement.querySelector(`.bd-article ${anchor}`);
if (anchorContent) return anchorContent.textContent;

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

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

console.warn(
"Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template."
"Content block not found. Sphinx search tries to obtain it via DOM query '.bd-article'. Check your theme or template."
);
return "";
},
Expand Down
9 changes: 4 additions & 5 deletions docs/_templates/components/search-field.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@
['backend', 'Backend'],
['classic-ui', 'Classic UI'],
['conceptual-guides', 'Conceptual Guides'],
['contributing', 'Contributing'],
['contributing', 'Contributing to Plone'],
['deployment', 'Deployment'],
['developer-guide', 'Developer Guide'],
['i18n-l10n', 'i18n/l10n'],
['glossary', 'Glossary'],
['i18n-l10n', 'Internationalization and Localization'],
['install', 'Install'],
['overview', 'Overview'],
['reference-guide', 'Reference Guide'],
['training', 'Training'],
['upgrade', 'Upgrade'],
['user-guide', 'User Guide'],
['plone.restapi', 'Plone REST API'],
['plone.api', 'Plone API'],
['volto', 'Volto'],
['volto', 'Volto UI'],
] %}
<option value="{{id}}">{{ title }}</option>
{% endfor %}
Expand Down