Closed mendax1234 closed 11 months ago
This one is going to be tricky to get working as the material/blog plugin does not offer many options to lure it into supporting multiple files per post.
At a first glance, supporting the material/blog plugin would require different techniques between suffix and folder i18n structures...
Friendly ping @squidfunk since I see that you're working on improving this plugin
We're working on stabilizing the blog plugin at the advent of the 9.2 release, and will also tackle the problem that the PR you linked attempts to fix – better support with plugins that allow to manage navigation dynamically. Currently, the blog plugin requires an explicit nav
. This requirement will be lifted before the 9.2 release, so it should work with awesome pages and other plugins. I'm, however, not sure what would be necessary to allow for working with this plugin, as I'm not familar with the different modes it supports. If we can make the blog plugin easily compatible, we're happy to do so, but I'm not sure what it would require. If you, @ultrabug, or somebody else would like to work on a PR that makes it compatible, without tying it to this plugin explicitly, we're happy to consider. However, we'd kindly ask you to wait until the 9.2 release, as the blog plugin will go through a major refactor in the light of MkDocs 1.5, as it makes managing generated files much, much easier ☺️
Absolutely okay to wait for 9.2 and the overall update of the plugin @squidfunk, thanks for your input.
I'll be glad to help and contribute what it takes to make it compatible with this plugin so that users will be able to get multilang blogs using both our projects!
Material for MkDocs 9.2 is out! The blog plugin was completely rewritten. I invite you to study the source code, it's heavily documented and pretty self-explanatory. Each page generated and managed by the blog plugin receives a distinct type, i.e., Post
, View
, Archive
, Category
and so forth. Those types can be imported and checked against by third-party plugins, something like:
from material.plugins.blog.structure import Post, View
def on_page_markdown(self, markdown, *, page, config, files):
# Handle blog post
if isinstance(page, Post):
pass
# Handle generated views, i.e., blog index, archive and category pages
elif isinstance(page, View):
pass
The following event priorities were given, so that third-party plugins can alter behavior before the blog plugin picks them up:
on_files
– @event_priority(-50)
on_nav
– @event_priority(-50)
on_page_markdown
– @event_priority(-50)
on_page_context
– @event_priority(-100)
That being said, we're happy to improve interop if you encounter any issues.
I'm happy to announce release v1.0.0 of the mkdocs-static-i18n
plugin which should fix this issue!
Blog plugin has been added to mkdocs material recently in beta version. However, l notice that this plugin doesn't support blog function. And the error is below:
Hope this bug can be fixed!