diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml new file mode 100644 index 0000000..bd62c49 --- /dev/null +++ b/.github/workflows/deploy-release.yml @@ -0,0 +1,22 @@ +name: Deploy release +on: + push: + tags: + - '*' +jobs: + pypi: + permissions: + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install dependencies + run: pip install -U build + - name: Build package + run: python -m build + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.tools/release.sh b/.tools/release.sh index 7a54d98..1bf36b6 100755 --- a/.tools/release.sh +++ b/.tools/release.sh @@ -11,5 +11,4 @@ hatch build git add */__init__.py git commit -m "v$1" git tag -a -m "" "v$1" -hatch publish git push origin master --tags diff --git a/README.md b/README.md index 301fc8c..9e41e46 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ nav: - Foo: borgs/foo.md plugins: + - search - section-index ``` diff --git a/mkdocs_section_index/__init__.py b/mkdocs_section_index/__init__.py index 874c99a..b3d4fc2 100644 --- a/mkdocs_section_index/__init__.py +++ b/mkdocs_section_index/__init__.py @@ -3,7 +3,7 @@ from mkdocs.structure.nav import Section from mkdocs.structure.pages import Page -__version__ = "0.3.7" +__version__ = "0.3.8" __all__ = ["SectionPage"] diff --git a/mkdocs_section_index/rewrites.py b/mkdocs_section_index/rewrites.py index 4928ea1..334161d 100644 --- a/mkdocs_section_index/rewrites.py +++ b/mkdocs_section_index/rewrites.py @@ -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)