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

Search related resources doesn't have a checksum parameter #13406

Open
tokuhirom opened this issue Mar 3, 2025 · 1 comment
Open

Search related resources doesn't have a checksum parameter #13406

tokuhirom opened this issue Mar 3, 2025 · 1 comment
Labels
type:proposal a feature suggestion

Comments

@tokuhirom
Copy link

Is your feature request related to a problem? Please describe.

in sphinx, normally, generated HTML include javascript/css using checksum paramter.

    <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=5ecbeea2" />
    <link rel="stylesheet" type="text/css" href="_static/basic.css?v=b08954a9" />
    <link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=27fed22d" />
    <script src="_static/documentation_options.js?v=82b2555a"></script>
    <script src="_static/doctools.js?v=9bcbadda"></script>
    <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="_static/translations.js?v=4755f45a"></script>

https://github.com/sphinx-doc/sphinx/blob/master/sphinx/themes/basic/layout.html#L77

but, in search.html, doesn't use the checksum value for searchtools.js/language_data.js.

    <script src="_static/documentation_options.js?v=82b2555a"></script>
    <script src="_static/doctools.js?v=9bcbadda"></script>
    <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="_static/translations.js?v=4755f45a"></script>
    <script src="_static/searchtools.js"></script>
    <script src="_static/language_data.js"></script>

https://github.com/sphinx-doc/sphinx/blob/master/sphinx/themes/basic/search.html#L6-L7

I suggest to add the checksum value to the javascripts that used in search.html to omit cache related issues.

Describe the solution you'd like

Add the app.add_search_js_file to manage the search related js files.

Describe alternatives you've considered

Expose the checksum related functions to the templates.

Current version of the js_tag(str) doesn't support checksum ...

if not isinstance(js, _JavaScript):

Additional context

If there's a add_search_js_file API, it makes easy to support the issues like #13395

@tokuhirom tokuhirom added the type:proposal a feature suggestion label Mar 3, 2025
@manasshete
Copy link

sphinx-build -b html sourcedir outputdir -T -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:proposal a feature suggestion
Projects
None yet
Development

No branches or pull requests

2 participants