-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Embedded JS: Conditionally inject jQuery #9861
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
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,7 +278,9 @@ def generate_rtd_data(self, docs_dir, mkdocs_config): | |
'global_analytics_code': ( | ||
None if self.project.analytics_disabled else settings.GLOBAL_ANALYTICS_CODE | ||
), | ||
'user_analytics_code': analytics_code, | ||
"user_analytics_code": analytics_code, | ||
"proxied_static_path": self.project.proxied_static_path, | ||
"proxied_api_host": self.project.proxied_api_host, | ||
Comment on lines
+282
to
+283
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We were missing including these for mkdocs, but it's only relevant when using a path different from |
||
} | ||
|
||
data_ctx = { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure if this is the way of doing it... but just adding the script from vendor/jquery.js doesn't add the global variables :/ /cc @agjohnson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, this is normal. Relying on every module to be a global is an antipattern that doesn't work well with various forms of module importing -- commonJS, AMD, ES6 module imports, etc. Modern JS would tend to use jQuery as a module instead.
Your change is about what I'd do.