mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix blank URL_ROOT
pathto doesn't expand in non-HTML templates so the workaround involves expanding it in the HTML file and passing it as a data attribute to the script.
This commit is contained in:
parent
6ad0ad6f17
commit
a7c6cb0180
@ -87,7 +87,7 @@
|
||||
{%- endmacro %}
|
||||
|
||||
{%- macro script() %}
|
||||
<script type="text/javascript" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
|
||||
{%- for scriptfile in script_files %}
|
||||
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
|
||||
{%- endfor %}
|
||||
|
@ -1,5 +1,5 @@
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: '{{ url_root }}',
|
||||
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
|
||||
VERSION: '{{ release|e }}',
|
||||
LANGUAGE: '{{ language }}',
|
||||
COLLAPSE_INDEX: false,
|
||||
|
Loading…
Reference in New Issue
Block a user