Repository navigation
Support theme customization with blocks - #947
Conversation
2e7907f to
e44a615
Compare
|
I was able to work out a solution for the If this backward incompatible change (with a clean upgrade path) is acceptable, I'll clean up the commit history so that the files aren't juggled back and forth (and so blame will still work on the lengthy |
|
I've only had time to scan this very quickly - but it looks cool. I'll try and review properly today/tomorrow. |
1c44d11 to
8dd6adf
Compare
| To enable this feature, the primary entry point for page templates has been | ||
| changed from `base.html` to `main.html`. This allows `base.html` to continue to | ||
| exist while allowing users to override `main.html` and extend `base.html`. For | ||
| version 1.16, `base.html` will continue to work if no `main.html` template |
|
I generally like this approach, I think it should work well and help a bunch of users. The only bit I don't like is the config setting I see two use cases for theme_dir at the moment.
Perhaps we could make the theme setting more flexible. Something like this might work (but again, I am not a huge fan of this idea): Some of this could be done as a follow up, as I don't want to block this work but I think it is relevant to the discussion. |
Right. As is stands now, if I'll address the other issues you raise when I have some time. Thanks for the feedback. You raise some good points. |
|
I'm removing the |
|
I just pushed another commit with should address your concerns @d0ugal. I added some more to the docs which should help clear things up. I left the cleanup as a separate commit so you can see what I changed. With your okay, I'll rebase and squash all of the commits before merging. |
Actually, I've thought for some time that something like this would be useful. The
I agree. Elsewhere we discussed creating a theme class or somesuch. I expect this would be part of that. |
|
Great, thanks! I'll try and give it another quick look tonight before merging, but if I don't manage it I am away until Monday. |
|
By the way, we can ignore the codecov failure. I think it is just complaining that out of the changed lines, the coverage decreased in |
This is a backward incompatable change as it switches the primary template from base.html to main.html. See the release notes for details. Partially addresses mkdocs#607.
|
I just cleaned up the history into two commits. All previous work was squashed into one commit and the second commit is my response to review. @d0ugal when you get a change to review and if it looks okay, you could merge is as-is, or if you prefer, let me know and I'll squash the two commits. Either is fine with me. |
|
Looks good. Thanks! I think this will be a great feature for many users. |
Partially addresses #607.
Note that we have to rename
base.htmltomain.htmland then create a newbase.htmlwhich is an empty file that "extends"main.html. We could reverse the roles of those two files, but that would be backward incompatible with existing custom/third party themes as all themes are loaded frombase.html. Existing custom themes may not have amain.htmland switching the role of the two files, despite being more sensible, could break existing custom and third party themes. Of course, if we want to make the backward incompatible change, now is the time to do it. Let me know and I'll update this PR.Also note that this provides a way for users to override the behavior of next/prev links when
include_next_previs deprecated (see #633, #679, #681, & #946), use a different analytics service, override search, and various other common requests -- all without any new config settings or Plugin API.