Skip to content

Commit

Permalink
Fix searchdata.bin download url in nested pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sizmailov committed Jun 27, 2020
1 parent 34c32ce commit d7e05ce
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion documentation/templates/python/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
{% endif %}
{% if SEARCH_DOWNLOAD_BINARY %}
<script>
Search.download({% if SEARCH_DOWNLOAD_BINARY is string %}'{{ SEARCH_DOWNLOAD_BINARY.format(SEARCHDATA_FORMAT_VERSION)|format_url|e }}'{% else %}window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + 'searchdata-v{{ SEARCHDATA_FORMAT_VERSION }}.bin'{% endif %});
Search.download({% if SEARCH_DOWNLOAD_BINARY is string %}'{{ SEARCH_DOWNLOAD_BINARY.format(SEARCHDATA_FORMAT_VERSION)|format_url|e }}'{% else %}window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) {% if site_root %} + '{{site_root}}' {% endif %} + 'searchdata-v{{ SEARCHDATA_FORMAT_VERSION }}.bin'{% endif %});
</script>
{% else %}
<script src="{{ 'searchdata-v{}.js'.format(SEARCHDATA_FORMAT_VERSION)|format_url|e }}" async="async"></script>
Expand Down
4 changes: 3 additions & 1 deletion documentation/test_python/page_nested/classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ <h1>Classes</h2>
</div>
</div>
<script src="search-v1.js"></script>
<script src="searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + 'searchdata-v1.bin');
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ <h1>
</div>
<script src="../../search-v1.js"></script>
<script> Search.siteRoot = "../../"; </script>
<script src="../../searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + '../../' + 'searchdata-v1.bin');
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ <h1>
</div>
<script src="../../search-v1.js"></script>
<script> Search.siteRoot = "../../"; </script>
<script src="../../searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + '../../' + 'searchdata-v1.bin');
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ <h1>
</div>
<script src="../../search-v1.js"></script>
<script> Search.siteRoot = "../../"; </script>
<script src="../../searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + '../../' + 'searchdata-v1.bin');
</script>
</body>
</html>
4 changes: 3 additions & 1 deletion documentation/test_python/page_nested/examples/bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ <h1>
</div>
<script src="../search-v1.js"></script>
<script> Search.siteRoot = "../"; </script>
<script src="../searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + '../' + 'searchdata-v1.bin');
</script>
</body>
</html>
4 changes: 3 additions & 1 deletion documentation/test_python/page_nested/examples/foo.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ <h1>
</div>
<script src="../search-v1.js"></script>
<script> Search.siteRoot = "../"; </script>
<script src="../searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + '../' + 'searchdata-v1.bin');
</script>
</body>
</html>
4 changes: 3 additions & 1 deletion documentation/test_python/page_nested/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ <h2>Advanced</h2>
</div>
<script src="../search-v1.js"></script>
<script> Search.siteRoot = "../"; </script>
<script src="../searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + '../' + 'searchdata-v1.bin');
</script>
</body>
</html>
4 changes: 3 additions & 1 deletion documentation/test_python/page_nested/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ <h1>
</div>
</div>
<script src="search-v1.js"></script>
<script src="searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + 'searchdata-v1.bin');
</script>
</body>
</html>
4 changes: 3 additions & 1 deletion documentation/test_python/page_nested/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ <h1>Modules</h2>
</div>
</div>
<script src="search-v1.js"></script>
<script src="searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + 'searchdata-v1.bin');
</script>
</body>
</html>
4 changes: 3 additions & 1 deletion documentation/test_python/page_nested/pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ <h1>Pages</h2>
</div>
</div>
<script src="search-v1.js"></script>
<script src="searchdata-v1.js" async="async"></script>
<script>
Search.download(window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1) + 'searchdata-v1.bin');
</script>
</body>
</html>
1 change: 1 addition & 0 deletions documentation/test_python/test_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test(self):
'examples/advanced/barz.rst',
],
'SEARCH_DISABLED': False,
'SEARCH_DOWNLOAD_BINARY': True,
'PLUGINS': [
'm.sphinx'
]
Expand Down

0 comments on commit d7e05ce

Please sign in to comment.