Skip to content
Closed
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
File renamed without changes.
10 changes: 5 additions & 5 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 All @@ -275,7 +275,7 @@ const Search = {
const query = new URLSearchParams(window.location.search).get("q");
const section = new URLSearchParams(window.location.search).get("section");
const select = document
.querySelector('select[name="section"]')
.querySelector('select[name="section"]');
document
.querySelectorAll('input[name="q"]')
.forEach((el) => (el.value = query));
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
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
# "<project> v<release> documentation".
html_title = "%(project)s v%(release)s" % {"project": project, "release": release}

html_css_files = ["documentation.css", ("print.css", {"media": "print"})]
html_css_files = ["search.css", ("print.css", {"media": "print"})]
html_js_files = []
html_extra_path = [
"robots.txt",
Expand Down