From 5ce23380810a911b164a99db7e1186e2938b945d Mon Sep 17 00:00:00 2001 From: Logan Bennett Date: Wed, 29 Apr 2026 23:07:52 -0700 Subject: [PATCH] Add tag to docs index to fix asset paths on no-slash URL When the docs are accessed at /neurodocker (no trailing slash), the browser resolves relative asset URLs against the root domain, causing CSS and JS to 404 and the index page to render unstyled. Sub-paths (/neurodocker/x.html or /neurodocker/dir) are unaffected because they already include a path component, so the issue is isolated to the docs root URL. Apply only on the index page so relative URLs resolve under /neurodocker/ regardless of trailing slash. Subpages keep the default Sphinx '../_static/...' relative paths, which work correctly. Closes #716. --- docs/_templates/layout.html | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/_templates/layout.html diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html new file mode 100644 index 00000000..d326efe5 --- /dev/null +++ b/docs/_templates/layout.html @@ -0,0 +1,7 @@ +{% extends "!layout.html" %} +{% block extrahead %} +{% if pagename == 'index' %} + +{% endif %} +{{ super() }} +{% endblock %}