Fix #9267: html theme: CSS and JS files added by theme were loaded twice

This commit is contained in:
Takeshi KOMIYA 2021-08-14 21:10:56 +09:00
parent 29d0205238
commit 3e5729b057
2 changed files with 6 additions and 3 deletions

View File

@ -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
--------

View File

@ -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)