pydata / pydata-sphinx-theme

A clean, three-column Sphinx theme with Bootstrap for the PyData community
https://pydata-sphinx-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
561 stars 304 forks source link

Correctly specify the source path to a logo to copy_asset_file #1746

Closed Cadair closed 1 month ago

Cadair commented 3 months ago

I think this fixes https://github.com/pydata/pydata-sphinx-theme/issues/1385, I think that bug report is expecting to be able to pass a logo in the docs/_static directory but according to the docs here: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/branding.html#different-logos-for-light-and-dark-mode the path should be relative to conf.py.

I think the actual bug is that we were not passing the correct source to the sphinx copy function which exits silently (for some reason) if the source does not exist.

Carreau commented 1 month ago

I've pushed an extra commit. As the code on line 73 was checking existence with respect srcdir, I think this is self-coherent, I think that wether we need to use srcdir, or confdir is a separate conversation.

Carreau commented 1 month ago

srcdir, or confdir

(we can potentially loop on both/warn/deprecate the wrong one).

github-actions[bot] commented 1 month ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/pydata_sphinx_theme
  logo.py
  translator.py
Project Total  

This report was generated by python-coverage-comment-action

Carreau commented 1 month ago

Ok, let's get that in, if we want to change from srcdir ton confdir we'll do that later.