Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] layout.html is incompatible with Sphinx>=6.0.0 #912

Closed
krivenko opened this issue Sep 4, 2023 · 1 comment
Closed

[doc] layout.html is incompatible with Sphinx>=6.0.0 #912

krivenko opened this issue Sep 4, 2023 · 1 comment

Comments

@krivenko
Copy link
Contributor

krivenko commented Sep 4, 2023

I am getting a theme error when trying to build the docs with Sphinx 7.2.5

Theme error:
An error happened in rendering the page ChangeLog.
Reason: UndefinedError("'logo' is undefined")

Is appears that Sphinx 6.0.0 renamed the logo variable in HTML templates and now it is called logo_url.

The offending HTML fragment is

<a href={{ pathto('index') }}>
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
</a>

Since layout.html is based on some code from sphinx_rtd_theme, I suggest doing the same thing as RTD's devs did,

+{%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %}
 <a href={{ pathto('index') }}>
-  <img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
+  <img src="{{ _logo_url }}" class="logo" alt="{{ _('Logo') }}"/>
 </a>

With this change, the documentation builds normally and the logo is properly displayed.

Wentzell added a commit to Wentzell/triqs that referenced this issue Sep 20, 2023
@Wentzell
Copy link
Member

Thank you @krivenko for pointing this out. This was fixed in 873e425

the-hampel pushed a commit that referenced this issue Jan 11, 2024
Wentzell added a commit to Wentzell/triqs that referenced this issue Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants