bashtage / sphinx-material

A material-based, responsive theme inspired by mkdocs-material
Other
312 stars 91 forks source link

html_minify doesn't work with the 'dirhtml' builder #114

Open duncanmmacleod opened 2 years ago

duncanmmacleod commented 2 years ago

The html_minify option uses a custom site_pages list to know what documents to minify, which is built as follows:

https://github.com/bashtage/sphinx-material/blob/3c3d1533a8ef09dad6987e06fc5375867c18c529/sphinx_material/__init__.py#L60-L61

which doesn't work when using the dirhtml builder, for which the page URL is something like

os.path.join(app.outdir, pagename + "/index.html")

...I think. If it's as easy as checking the builder in an if statement, I might be able to put together a patch.

bashtage commented 2 years ago

A PR is welcome. Thanks.