Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language_data.js is loaded from all pages. #8419

Closed
methane opened this issue Nov 14, 2020 · 2 comments
Closed

language_data.js is loaded from all pages. #8419

methane opened this issue Nov 14, 2020 · 2 comments

Comments

@methane
Copy link
Contributor

methane commented Nov 14, 2020

Describe the bug

language_data.js is used by searchtools.js.

But language_data.js is loaded in all pages.

self.add_js_file('language_data.js')

Can we move it to search.html?

<script src="{{ pathto('_static/searchtools.js', 1) }}"></script>

To Reproduce

See this page and show source.
https://docs.python.org/3/library/stdtypes.html

Expected behavior

If language_data.js is used only by searchtool.js, don't load language_data.js unless searchtool.js is loaded.

Your project
python/cpython project, Docs/

Environment info

  • Sphinx version: 2.4.4.

Additional context

@tk0miya tk0miya added this to the 3.4.0 milestone Nov 18, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Nov 18, 2020
…-search pages

The ``language_data.js`` is only used on search page.  But it is always
loaded meaninglessly.  This fixes not to load it on all non-search pages.
@tk0miya
Copy link
Member

tk0miya commented Nov 18, 2020

Thank you for reporting. It will be fixed soon.

tk0miya added a commit that referenced this issue Nov 20, 2020
…_search_page

Fix #8419: html search: Do not load language_data.js in non-search pages
@pedrohdz
Copy link

@tk0miya
It seems as if search is broken from this change forward. I opened a new issue regarding this issue: #8623.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants