readthedocs / sphinx_rtd_theme

Sphinx theme from Read the Docs
https://sphinx-rtd-theme.readthedocs.io/
MIT License
4.81k stars 1.74k forks source link

Cannot fall back from ``logo_url`` to ``logo`` #1487

Closed DrewDevereux closed 1 year ago

DrewDevereux commented 1 year ago

This line apparently intends that if the logo_url setting is unspecified in conf.py, then we fall back to the value of the logo setting from conf.py (with suitable _static/ prepend).

{%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %}

But I don't think it works. It appears that if the logo_url setting is unspecified in conf.py, then it takes an empty string value here, and the default filter passes it through untouched. A fix would be to use or instead:

{%- set _logo_url = logo_url or pathto('_static/' + (logo or ""), 1) %}

(Also favicon_url / favicon here.)

DrewDevereux commented 1 year ago

nvm, it's only an empty string in newer versions of Sphinx. In older versions it is null.