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
blog plugin breaks when trying to use 2 blog instances #4542
Comments
Thanks for reporting. Did you create
|
Sorry if it wasnt cleared, yup I have |
Thanks! So first of all, your configuration is missing an integral part of the blog plugin configuration, namely where in the navigation the blog plugin should be mounted. This is explained in the documentation: nav:
- Blog:
- blog/index.md
- Tutorial:
- tutorial/index.md
plugins:
- blog:
blog_dir: blog
- blog:
blog_dir: tutorial I've improved the error reporting, so the blog plugin will now fail with a better message when the There was another problem with the way the blog plugin tricks MkDocs into not reporting the blog posts before the |
I don't think MkDocs ever intended to support specifying the same plugin multiple times. The main thing for MkDocs to add in that case would be a more direct error message... |
I suppose I could instead choose to "properly" support multiple instances of the same plugin. I implement it here. https://github.com/mkdocs/mkdocs/compare/inst It works as expected then, as far as I see. - blog:
blog_custom_dir: overrides
- blog:
blog_dir: tutorial
blog_dzir: tutorial The log message now looks like
(note the |
Please do give feedback whether you think this should be unleashed upon the world 😅 |
Would the setup require |
@zerenxyz please never use |
LGTM! I installed MkDocs from the In the meantime, you just need to install MkDocs from
|
Awesome! Does that break anything if I have MkDocs material and insiders installed via pip? |
I'm basically already tracking this MkDocs feature in this issue, so I may as well put this out here: I plan to require the plugin to set an attribute |
And I do plan to include this in 1.4.2 - within a week |
Released as part of 8.5.8+insiders-4.26.2. MkDocs version was bumped to 1.4.2 and the tags and blog plugin now allow for multiple instances, thanks to @oprypin. |
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
I am trying to create 2 blog post locations, when declaring the plugin blog with their own blog_dir it breaks giving AttributeError: 'NoneType' object has no attribute 'append'
Expected behaviour
It should work with 2 blogs running independently
Actual behaviour
I get an error when running
mkdocs serve
of the following:Steps to reproduce
Package versions
3.10.7
1.4.1
8.5.7+insiders.4.26.1
Configuration
System information
The text was updated successfully, but these errors were encountered: