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

Use with CDN #103

Closed
QuLogic opened this issue Jun 27, 2014 · 3 comments
Closed

Use with CDN #103

QuLogic opened this issue Jun 27, 2014 · 3 comments

Comments

@QuLogic
Copy link

QuLogic commented Jun 27, 2014

We (at obspy/obspy) are hosting our documentation online and would like to switch to the bootstrap theme. There are two important optimizations lacking though. First is loading CSS and JS from a CDN. Second is deferring JS loading to the end of the document.

My first attempt at achieving this was to extend layout.html, and overwrite css_files and scripts_files with CDN links instead. Unfortunately, this does not work because jinja2 executes statements outside blocks in reverse. So it seems the only way to get this to happen is to have the bootstrap theme support it natively.

@ryan-roemer
Copy link
Owner

@QuLogic -- We have to minorly patch Bootstrap to use our "no conflict" jQuery since out-of-the box Sphinx won't work with BS 2 or BS3. So, I'm not sure how feasible this is without a "more impactful" change of also overriding jQuery site-wide... /cc @russell

@QuLogic
Copy link
Author

QuLogic commented Jul 2, 2014

out-of-the box Sphinx won't work with BS 2 or BS3

I assume this is something that #92 would fix?

@ryan-roemer
Copy link
Owner

@QuLogic Unfortunately, no -- we have to patch Bootstrap source itself. See, e.g., this line: https://github.com/ryan-roemer/sphinx-bootstrap-theme/blob/master/sphinx_bootstrap_theme/bootstrap/static/bootstrap-3.1.0/js/bootstrap.js#L56 -- we have to do that everywhere to ensure the theme plays well with older Sphinx's that need old jQuery.

So, I'm going to close this issue as "currently impossible" unless a new approach or tactic comes up...

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

No branches or pull requests

2 participants