-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add more blocks to simple base template #3405
base: main
Are you sure you want to change the base?
Add more blocks to simple base template #3405
Conversation
This change makes it easier to create new themes by inheriting from the simple theme. It allows customization of the whole body (while still making use of the theme’s head), or individual parts of the body like header, menu, or footer.
Any feedback on this PR from @getpelican/reviewers? |
It is traditional to have blocks for header and footer, so that seems like a decent idea. It might also be traditional to separate them out into footer.html and header.html, though I wouldn't insist. I don't see customization of the menu, although that is mentioned in the description of this PR. My bigger questions:
|
Sorry for not getting back to this earlier. Thanks for the comments.
Yes, separating them out is also a good idea, and it would make it easy to override them without even touching the base template. It would require a bit more understanding of the file layout, though, so for beginners having a single file to override might even be simpler. But I’m open to both suggestions. A slightly related question: At the moment, the blocks are defined within the corresponding elements, i.e., there’s a
That’s the block
I’m teaching SSGs with Pelican to university students, and one issue is customizing the appearance without having to write a full theme. My understanding for the existence of the simple theme was that it would be a starting point for simple customizations, which is what the docs suggest. The reason for the PR is that customization works well for the use case in the docs (mainly providing a custom CSS file), but going beyond that requires a customized copy of the base template. This PR would offer a middle way of reusing the simple theme, but allowing more customization. And I think it would even be useful for theme authors. (I’m currently writing a simple custom theme that basically uses this mechanism.)
I’m happy to provide a test, but I’m not really sure what the test would cover? |
Sounds good. What's an SSG?
Literally any line of code that you changed. For example, override the footer and test that the new footer shows up. |
SSG is short for static site generator. |
This change makes it easier to create new themes by inheriting from the simple theme. It allows customization of the whole body (while still making use of the theme’s head), or individual parts of the body like header, menu, or footer.
Pull Request Checklist