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

ABlog support for furo theme #108

Open
damian-krawczyk opened this issue Jul 13, 2021 · 19 comments · Fixed by #144
Open

ABlog support for furo theme #108

damian-krawczyk opened this issue Jul 13, 2021 · 19 comments · Fixed by #144

Comments

@damian-krawczyk
Copy link

Description

Hi,
I would like to use ABlog with furo theme, but I'm encountering an error:

Here simple example with alabaster theme (works with ablog):
https://sphinx-ablog-alabaster.readthedocs.io/en/latest/
https://github.com/damian-krawczyk/sphinx-ablog-alabaster
conf.py : html_theme = 'alabaster'

Here simple example with pydata_sphinx_theme (works with ablog)
https://sphinx-ablog-pydata-sphinx-theme.readthedocs.io/en/latest/
https://github.com/damian-krawczyk/sphinx-ablog-pydata_sphinx_theme
conf.py : html_theme = 'pydata_sphinx_theme'

Here simple example with furo (doesn't work with ablog, see error)
https://sphinx-ablog-furo.readthedocs.io/en/latest/
https://github.com/damian-krawczyk/sphinx-ablog-furo
conf.py : html_theme = 'furo'

The only difference in listed repositories is mentioned config.

I've already raised issue for furo but before I get back to them I would like to get feedback from you to make sure that this is not something to be fixed on your side?

@nabobalis nabobalis added the Bug label Jul 13, 2021
@nabobalis
Copy link
Contributor

nabobalis commented Jul 13, 2021

Ah I see its from the URL. I missed that.

Honestly, I have no real idea where to start with that error.

@sudopluto
Copy link

commented on the furo issue, but it looks like that theme doesn't allow using layout.html. luckily, only two places it's referenced in ablog: https://github.com/sunpy/ablog/search?q=layout.html

@jmones
Copy link

jmones commented Aug 15, 2021

I don't know much about the Sphinx template system (I just started tried to setup a blog with furo theme).

Tried to extend page.html and redirect.html from furo's page.html instead of layout.html seemed to work for both listings and redirections. It also seemed to keep working with alabaster theme.

Tried that with this patch and @damian-krawczyk 's PoC https://github.com/damian-krawczyk/sphinx-ablog-furo
patch_to_make_ablog_work_with_furo.diff.txt

I don't know if this will break other themes or end users installations.

I don't propose a PR directly because I don't understand either why Sphinx Doc proposed different layout.html and page.html templates and how each one is supposed to be used (if someone could post an explanation, that would be interesting).

And I have no idea either of which option is the best for this issue:

  • make ablog use page.html (this patch)
  • make juro allow users and extensions to override layout.html
  • setting an option in ablog to allow users select which base template it's going to be overriden (https://github.com/wpilibsuite/sphinxext-rediraffe seems to do something like that with their rediraffe_template configuration option)
  • ...

@jmones
Copy link

jmones commented Aug 15, 2021

The previous patch was wrong... Didn't work when I tried to use it in a more complex example. This seems to be better:
patch_to_make_ablog_work_with_furo_take_2.diff.txt

@damian-krawczyk
Copy link
Author

damian-krawczyk commented Sep 29, 2021

At furo's end Issue moved from Issues to Discussions by @pradyunsg pradyunsg/furo#262

@damian-krawczyk
Copy link
Author

@nabobalis Can you check furo's comment?

pradyunsg/furo#262 (reply in thread)

@nabobalis
Copy link
Contributor

@nabobalis Can you check furo's comment?

pradyunsg/furo#262 (reply in thread)

I see, if someone wants to fix this assumptions, I am happy to accept the patch.

@stonecharioteer
Copy link

Is anyone working on this? @nabobalis I can try to contribute.

@nabobalis
Copy link
Contributor

Is anyone working on this? @nabobalis I can try to contribute.

I am not aware that anyone is working on it. If you want to try to help, please go ahead.

@pradyunsg
Copy link
Contributor

pradyunsg commented Jan 21, 2022

I've proposed an approach for solving this problem, at scale, in #125 that I think will be more sustainable for all the maintainers involved.

@SilverRainZ
Copy link
Contributor

SilverRainZ commented Jan 30, 2024

Doesn't this issue seem to be fixed? I can reproduce it on sphinx 6.2.1 + ablog 0.11.6 + furo 2024.

SilverRainZ added a commit to SilverRainZ/ablog-demo that referenced this issue Jan 30, 2024
@SilverRainZ
Copy link
Contributor

I found that there are still {%- extends "!layout.html" %} in ablog/redirect.html:

{%- extends "!layout.html" %}

@nabobalis
Copy link
Contributor

I should add a test build to check compatibility with furo.

@nabobalis nabobalis reopened this Jan 31, 2024
@SilverRainZ
Copy link
Contributor

@nabobalis Any plan to fix it? I have no idea how to do that :'(

@nabobalis
Copy link
Contributor

I will try but I won't promise an ETA.

@Jaharmi
Copy link

Jaharmi commented Mar 4, 2024

I still see the “layout.html” problem as well.

ERROR: This page was generated by inheriting from "layout.html".

Furo (the documentation theme that this site is generated with) does not support this, and has generated this page. If you are the author of this documentation, please look into why this page was generated using the "layout.html" template and fix the root cause.

Debugging information, if you need to report this error somewhere:
Sphinx: 7.2.6
Furo: 2024.01.29

pagename: index

This is with Ablog 0.11.6. The moment I set the template to Furo when Ablog is enabled, I get this problem. If I change either the theme or disable the Ablog extension, the problem goes away.

@damian-krawczyk
Copy link
Author

Hi @errbufferoverfl
Looks like you have been able to solve it out here https://www.errbufferoverfl.me

Could you share some thoughts on how to make it work?

@hspaans
Copy link

hspaans commented Jul 1, 2024

@damian-krawczyk the furo repository was forked and modified to make it work, see https://github.com/pradyunsg/furo/compare/main...errbufferoverfl:furo:main?diff=unified&w= for the diff.

Looking at a lot of other themes all are using layout.html instead of base.html that furo is using to work around this requirement in Sphinx Theme documentation:

When extending a template in the base theme with the same name, use the theme name as an explicit directory: {% extends "basic/layout.html" %}. From a user templates_path template, you can still use the “exclamation mark” syntax as described in the templating document.

To be honest I wonder if it will not be easier and quicker to fork furo and make it follow the file layout other themes are using or figure out a way to make ablog work with furo that would be a one-off as it looks right now.

@ABD-01
Copy link

ABD-01 commented Sep 6, 2024

Ablog with Furo

TL;DR

See ablog_with_furo

Body

Hi
I was facing a similar issue while using Ablog along with furo.

Based on comments from

I forked Ablog and created ablog_with_furo

Now to use this I suggest using the exts directory as suggested by sphinx in their documentation

You can use submodule for this

git submodule add https://github.com/ABD-01/ablog_with_furo.git exts/ablog

For instance how I used it in my repo

I have also added meta data for posts below the title
image

You can view the Ablog's documentation build using furo here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants