getpelican / pelican-themes

Themes for Pelican
https://getpelican.com/
2.12k stars 1.09k forks source link

Broken themes #645

Open ivanhercaz opened 5 years ago

ivanhercaz commented 5 years ago

I am trying to set up the new version of my personal website with Pelican and GitHub Pages. I would like to use another theme, not the default one, but in most of them I get this error:

CRITICAL: TypeError: not all arguments converted during string formatting make: *** [Makefile:75: publish] Error 1

My Pelican's version is 4.0.1, but I think it also happens with 3.7.1 because I executed make github one time out of my environment and I get the same error. This error has been addressed in getpelican/pelican#2489, although I don't know nor understand why the issue is closed when the error persists.

The website don't offer any way to filter it nor the themes have sufficient data to know if one is supported by one or another version of Pelican. Thus I want to emphasize in the importance of #630 and #354.

The given "solution" in the mentioned issue is to change every part of the error that is wrong (replace pipes by dots, and some things more), but it is a bit heavy to make it soon and if someone want to set up quickly a website with Pelican . Thus I also want to compile here the templates that produce this error with all the possible details to solve it in the future.

Theme Has error? Comments
Apricot Yes Latest commit: 28 Feb 2016
Attila Yes Latest commit: 19 Sep 2016 (there is a development version but fails too)
Backdrop Yes Latest commit: 10 Sep 2016
Clean Blog Yes Latest commit: 5 Sep 2015
Nest Yes Latest commit: 22 Sep 2015

And probably there are more... I just checked some of them, but I think it is necessary, with patience, to review every theme in the repository. For the moment I am going to use the pelican-blue theme, it works fine. But I can confirm that cebong and Flex themes works too.

iranzo commented 5 years ago

What I did is to check the latest update on each repo and decide... in the end I went for Pelican-Elegant which has been pretty active and even accepting contributions to the things I found missing

leekimber commented 2 years ago

Versions of Medius and pelican-html5up-spectral with this specific issue fixed are available in my repo.

The problem seems reasonably simple to fix once you know the ins and outs of it:

  1. Open the theme's templates/base.html file
  2. Replace all instances of "|format(" with ".format(slug='" and then all instances of ".slug)" with ".slug')"
  3. Save and test.

Here are my vim editor commands to fix it in the base.html file:

  1. :%s/|format(/.format(slug='/gc
  2. :%s/.slug)/.slug')/gc

Theoretically, it's possible to run these two search and replaces across the entire set of theme repositories. I'd be up for doing that if others are up for testing the results. :-)

This problem being present in so many themes (due to pelican's popularity and heritage) leaves me wondering if it would be more viable to manage a showcase of known-working themes (perhaps using a tool like this). Then de-list problematic themes or send them to a 'For repair' site where they can be fixed by those with an interest.

Put another way, the fix seems easy; the challenge is managing the ongoing maintenance of so many themes.

maphew commented 1 year ago

related: #677