Skip to content

Commit 3b8cc13

Browse files
authored
Fix theme directory access (#30)
Fixes #28
1 parent 2ae68c1 commit 3b8cc13

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ntd2d/ntd2d_action/sphinxdocs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ def inherited_layout(self):
161161
`{% extends "!layout.html" %}` should work, but doesn't.
162162
https://github.com/sphinx-doc/sphinx/issues/12049
163163
"""
164-
def get_theme_layout(theme):
165-
if (pathlib.Path(theme.themedir) / "layout.html").exists():
166-
return f"{theme.name}/layout.html"
167-
else:
168-
return get_theme_layout(theme.base)
164+
theme = self.get_theme(self.inherited_theme)
165+
for dir in theme.get_theme_dirs():
166+
layout = pathlib.Path(dir) / "layout.html"
167+
if layout.exists():
168+
break
169169

170-
return get_theme_layout(self.get_theme(self.inherited_theme))
170+
return layout.as_posix()
171171

172172
def assimilate_theme(self, name, insert_header_footer=True):
173173
"""Replace configuration directory with customized html theme."""

0 commit comments

Comments
 (0)