- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 fails with StopIteration when no nav entry is present #6041
Comments
Hi, thanks for the reproduction. I will try to look at this but am traveling across timezones today, so not sure exactly how much time I will have before Monday. Since the blog plugin is one of the newer ones, I am keen to gain an understanding of how it works and this seems like a good test case. Please bear with me, I am new to trying to fix things in mkdocs-material. |
@alexvoss thanks for offering to take this on. I found some time to tackle this and I'm going to look into this right now. I'm happy to give you an introduction on the blog plugin later, as there are still some edge cases to fix |
Fixed in 50c273c. In the minimal reproduction, the blog was explicitly not linked in the navigation, and thus, has no parent section assigned, which we need for correctly resolving the location at which we attach the archive and category views. We now check if the blog was explicitly not linked, and in this case, still generate all views, but do not try to link them in the navigation. All generated pages will not have previous and next pages assigned to them, which is now correct, since it's unclear what the previous and next page is without the blog being part of the navigation. Note that when building a standalone blog, the entrypoint has no parent page as well (it's at the top-level), so we use the top-level of the navigation to resolve its siblings and append it to the end. Thus, we must check if we're building a standalone (i.e., top-level) blog or not, and branch accordingly. |
Released as part of 9.4.2. |
Context
As requested in #6039 here's a reproduction of the issue described there.
Bug description
I'm using the blog plugin to provide a "News" section on an mkdocs-material site. This includes a name different than "blog" for the
blog_dir
setting. When there is no entry for thenews/index.md
file the serving/building of the site fails with aStopIteration
in the blog plugin:Related links
Reproduction
9.3.2-blog-build-fails.zip
Steps to reproduce
mkdocs serve
Browser
No response
Before submitting
The text was updated successfully, but these errors were encountered: