Skip to content

Commit

Permalink
Adapt template rewrite path to MkDocs-Material 9.4 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Temminghoff authored Sep 22, 2023
1 parent e1d5a22 commit 8adc200
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions mkdocs_section_index/rewrites.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,20 @@ def get_source(
if path.endswith("/mkdocs/templates/sitemap.xml"):
src = _transform_mkdocs_sitemap_template(src)
else:
if path.endswith("/material/partials/nav-item.html"):
# the second path is used in MkDocs-Material >= 9.4
if path.endswith(
(
"/material/partials/nav-item.html",
"/material/templates/partials/nav-item.html",
),
):
src = _transform_material_nav_item_template(src)
elif path.endswith("/material/partials/tabs-item.html"):
elif path.endswith(
(
"/material/partials/tabs-item.html",
"/material/templates/partials/tabs-item.html",
),
):
src = _transform_material_tabs_item_template(src)
elif path.endswith("/themes/readthedocs/base.html"):
src = _transform_readthedocs_base_template(src)
Expand Down

0 comments on commit 8adc200

Please sign in to comment.