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

Inlcuding jquery.js in layout.html #1501

Open
kapooramit opened this issue Aug 13, 2023 · 3 comments
Open

Inlcuding jquery.js in layout.html #1501

kapooramit opened this issue Aug 13, 2023 · 3 comments
Labels
Support Support question

Comments

@kapooramit
Copy link

kapooramit commented Aug 13, 2023

I am trying to follow the instruction to include jquery.js in the layout.html by adding the following lines to the layout.html in the <head>.

{%- block scripts %}
    <script src="{{ pathto('_static/jquery.js', resource=True) }}"></script>
    <script src="{{ pathto('_static/underscore.js', resource=True) }}"></script>
    {{ super() }}
{%- endblock %}

[https://github.com/sphinx-doc/sphinx/issues/7405]

However, the above code causes the output HTML to throw the double script block error. If I remove {{super()}}, I get $ is not defined, followed by jquery is not defined.

What am I doing wrong? I want to include jquery and underscore in my custom RTD theme.

@PhantomRwcwride2Zero
Copy link

PhantomRwcwride2Zero commented Aug 13, 2023 via email

@kapooramit
Copy link
Author

@nienn : Can you suggest?

@humitos
Copy link
Member

humitos commented Aug 22, 2023

What am I doing wrong? I want to include jquery and underscore in my custom RTD theme.

Read the Docs theme already includes jQuery. You should only include underscore on yours.

@humitos humitos added the Support Support question label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests

3 participants