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

Alternate themes preview using Github Pages #740

Closed
maphew opened this issue Dec 28, 2022 · 13 comments · Fixed by #748
Closed

Alternate themes preview using Github Pages #740

maphew opened this issue Dec 28, 2022 · 13 comments · Fixed by #748

Comments

@maphew
Copy link
Contributor

maphew commented Dec 28, 2022

Building on the proof of concept outlined in #731 I've created a pelican-themes-preview repository that generates a static site for each of the themes in the getpelican/pelican-themes repo (that aren't broken) and publishes them to Github Pages. There's an Action defined that builds and publishes the site when a PR is merged to main branch.

It's a dumb brute force approach and takes up to 10 minutes to complete. An obvious improvement would be to only regenerate the folder tree for the particular theme(s) being updated in the PR instead of all of them all the time. (I don't know how to do that. Hopefully someone else here does?)

Results: https://maphew.github.io/pelican-themes-preview/
Repo: https://github.com/maphew/pelican-themes-preview/

I'm happy to transfer ownership of the repo to the Getpelican organization so that it doesn't become yet another 3rd party dependency in the wings.

Screenshot of 4 of the working resultant themes:

image

@maphew
Copy link
Contributor Author

maphew commented Dec 31, 2022

For my purposes this is feature complete, though some tuning could be done on the sample content so that there is more coverage of the various text and image types theme developers will want to apply styles to.

I'm not issuing a PR to merge into here because it's not clear to me what the cleanest way to do that is (so the preview and sample content isn't confused for themes themselves). However I'm willing to do that work if there is interest.

Leaving open because as long as the old preview site is broken this should remain visible.

@maphew
Copy link
Contributor Author

maphew commented Dec 31, 2022

An image gallery of the themes that worked: https://imgur.com/gallery/cL2HI2e.
Not part of the preview site yet because I'm having trouble getting headless browser to work inside Github codespaces/actions machines.

@JoshuaAdrianJones
Copy link

@maphew This is excellent because http://www.pelicanthemes.com/ is still dead for me today, thank you!

@bittner
Copy link

bittner commented Mar 14, 2023

This is excellent!

I'm happy to transfer ownership of the repo to the Getpelican organization so that it doesn't become yet another 3rd party dependency in the wings.

@justinmayer Would you be okay with that?

We could then continue to work on performance optimization (as mentioned by @maphew) and add an overview page with a preview gallery and labels to filter the themes. I don't remember how the broken preview site looked like recently (i.e. if those features were already there), so hopefully this suggestion doesn't offend anyone. 🙏

For filtering I only have the Static Site Generators website as an example. We might be able to do better.

@avaris
Copy link
Member

avaris commented Apr 29, 2023

This is nice.

I'm not issuing a PR to merge into here because it's not clear to me what the cleanest way to do that is (so the preview and sample content isn't confused for themes themselves). However I'm willing to do that work if there is interest.

We can maaaybe use github actions to create the preview site under this repo.

@maphew
Copy link
Contributor Author

maphew commented Apr 30, 2023

I'm not issuing a PR to merge into here because it's not clear to me what the cleanest way to do that is (so the preview and sample content isn't confused for themes themselves). However I'm willing to do that work if there is interest.

We can maaaybe use github actions to create the preview site under this repo.

I tried and failed using GH actions to create previews in my repo, the process would get axed because of over memory or cpu consumption. However I recently learned of Simon Willison's shot-scraper tool which looks promising, maphew/pelican-themes-preview#6

@avaris
Copy link
Member

avaris commented Apr 30, 2023

High cpu/memory was from generating the screenshots, I assume? I don't know if it is necessary. Worst case, we can put sites in an index inside iframes instead of screenshots :).

@maphew
Copy link
Contributor Author

maphew commented Apr 30, 2023

High cpu/memory was from generating the screenshots, I assume? I don't know if it is necessary. Worst case, we can put sites in an index inside iframes instead of screenshots :).

Solved! Simon's shot-scraper works brilliantly.

@avaris
Copy link
Member

avaris commented Apr 30, 2023

@maphew Heavily inspired by your efforts, I gave it a try to build preview site under my fork, works quite fine: https://avaris.github.io/pelican-themes/

I'll try integrating taking screenshots and adding it to the index next... when I get more time :).

@avaris
Copy link
Member

avaris commented May 2, 2023

Screenshots are added as well, again thanks to your work @maphew. I need to cleanup the script and add some error checking in case someone wants to run that locally, but this turned out quite nice :).

Edit: Some submodule themes (e.g. alchemy) are behaving like "packages". Actual theme is inside a folder within the theme folder. Even though they appear to run successfully, they are not properly generated. I need to look into that.

@maphew
Copy link
Contributor Author

maphew commented May 3, 2023

that looks great @avaris, and thanks for uncovering what is going on with alchemy and friends.

@justinmayer
Copy link
Member

https://pelicanthemes.com is now back up. Many thanks to @maphew and @avaris for their work on this! 🎊

@maphew
Copy link
Contributor Author

maphew commented Jul 24, 2023

This is great news! I'm happy to have helped nudge the endeavour forward. :)

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

Successfully merging a pull request may close this issue.

5 participants