mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Remove search highlights from the page and the history
Co-authored-by: the-sink <lucianedean@gmail.com>
This commit is contained in:
@@ -1090,12 +1090,21 @@ kbd.compound > .kbd,
|
|||||||
background-color: var(--navbar-current-background-color-active);
|
background-color: var(--navbar-current-background-color-active);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hide the obnoxious automatic highlight in search results */
|
/* Hide the obnoxious automatic highlight from the search context. */
|
||||||
.rst-content .highlighted {
|
.rst-content .highlighted {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
box-shadow: none;
|
||||||
font-weight: inherit;
|
font-weight: inherit;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
/* Still slightly highlight matched parts on the dedicated search results page. */
|
||||||
|
.rst-content #search-results .highlighted {
|
||||||
|
background-color: #ffcd0029;
|
||||||
|
border-radius: 2px;
|
||||||
|
color: var(--body-color);
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0 3px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Allows the scrollbar to be shown in the sidebar */
|
/* Allows the scrollbar to be shown in the sidebar */
|
||||||
@media only screen and (min-width: 769px) {
|
@media only screen and (min-width: 769px) {
|
||||||
|
|||||||
@@ -233,6 +233,14 @@ const registerSidebarObserver = (function(){
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
|
// Remove the search match highlights from the page, and adjust the URL in the
|
||||||
|
// navigation history.
|
||||||
|
const url = new URL(location.href);
|
||||||
|
if (url.searchParams.has('highlight')) {
|
||||||
|
Documentation.hideSearchWords();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize handlers for page scrolling and our custom sidebar.
|
||||||
const mediaQuery = window.matchMedia('only screen and (min-width: 769px)');
|
const mediaQuery = window.matchMedia('only screen and (min-width: 769px)');
|
||||||
|
|
||||||
registerOnScrollEvent(mediaQuery);
|
registerOnScrollEvent(mediaQuery);
|
||||||
|
|||||||
4
conf.py
4
conf.py
@@ -189,14 +189,14 @@ html_extra_path = ["robots.txt"]
|
|||||||
html_css_files = [
|
html_css_files = [
|
||||||
'css/algolia.css',
|
'css/algolia.css',
|
||||||
'https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css',
|
'https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css',
|
||||||
"css/custom.css?2", # Increment the number at the end when the file changes to bust the cache.
|
"css/custom.css?3", # Increment the number at the end when the file changes to bust the cache.
|
||||||
]
|
]
|
||||||
|
|
||||||
if not on_rtd:
|
if not on_rtd:
|
||||||
html_css_files.append("css/dev.css")
|
html_css_files.append("css/dev.css")
|
||||||
|
|
||||||
html_js_files = [
|
html_js_files = [
|
||||||
"js/custom.js?1", # Increment the number at the end when the file changes to bust the cache.
|
"js/custom.js?2", # Increment the number at the end when the file changes to bust the cache.
|
||||||
('https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js', {'defer': 'defer'}),
|
('https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js', {'defer': 'defer'}),
|
||||||
('js/algolia.js', {'defer': 'defer'})
|
('js/algolia.js', {'defer': 'defer'})
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user