mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #9267: html theme: CSS and JS files added by theme were loaded twice
This commit is contained in:
parent
29d0205238
commit
3e5729b057
1
CHANGES
1
CHANGES
@ -34,6 +34,7 @@ Bugs fixed
|
||||
* #9481: cpp domain: some warnings contain non-existing filenames
|
||||
* #9456: html search: abbreation marks are inserted to the search result if
|
||||
failed to fetch the content of the page
|
||||
* #9267: html theme: CSS and JS files added by theme were loaded twice
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -287,13 +287,14 @@ class StandaloneHTMLBuilder(Builder):
|
||||
|
||||
if dark_style is not None:
|
||||
self.dark_highlighter = PygmentsBridge('html', dark_style)
|
||||
self.add_css_file('pygments_dark.css',
|
||||
media='(prefers-color-scheme: dark)',
|
||||
id='pygments_dark_css')
|
||||
self.app.add_css_file('pygments_dark.css',
|
||||
media='(prefers-color-scheme: dark)',
|
||||
id='pygments_dark_css')
|
||||
else:
|
||||
self.dark_highlighter = None
|
||||
|
||||
def init_css_files(self) -> None:
|
||||
self.css_files = []
|
||||
self.add_css_file('pygments.css', priority=200)
|
||||
self.add_css_file(self._get_style_filename(), priority=200)
|
||||
|
||||
@ -311,6 +312,7 @@ class StandaloneHTMLBuilder(Builder):
|
||||
self.css_files.append(Stylesheet(filename, **kwargs))
|
||||
|
||||
def init_js_files(self) -> None:
|
||||
self.script_files = []
|
||||
self.add_js_file('documentation_options.js', id="documentation_options",
|
||||
data_url_root='', priority=200)
|
||||
self.add_js_file('jquery.js', priority=200)
|
||||
|
Loading…
Reference in New Issue
Block a user