diff --git a/ntd2d/ntd2d_action/sphinxdocs.py b/ntd2d/ntd2d_action/sphinxdocs.py index e38d949..0271e0f 100644 --- a/ntd2d/ntd2d_action/sphinxdocs.py +++ b/ntd2d/ntd2d_action/sphinxdocs.py @@ -161,13 +161,13 @@ def inherited_layout(self): `{% extends "!layout.html" %}` should work, but doesn't. https://github.com/sphinx-doc/sphinx/issues/12049 """ - def get_theme_layout(theme): - if (pathlib.Path(theme.themedir) / "layout.html").exists(): - return f"{theme.name}/layout.html" - else: - return get_theme_layout(theme.base) + theme = self.get_theme(self.inherited_theme) + for dir in theme.get_theme_dirs(): + layout = pathlib.Path(dir) / "layout.html" + if layout.exists(): + return layout. - return get_theme_layout(self.get_theme(self.inherited_theme)) + return layout.as_posix() def assimilate_theme(self, name, insert_header_footer=True): """Replace configuration directory with customized html theme."""