Skip to content
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: missing integrated table of contents in pagination #5715

Closed
4 tasks done
jiegec opened this issue Jul 15, 2023 · 10 comments
Closed
4 tasks done

Blog: missing integrated table of contents in pagination #5715

jiegec opened this issue Jul 15, 2023 · 10 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@jiegec
Copy link

jiegec commented Jul 15, 2023

Context

No response

Bug description

A table of contents is generated for the index page, but not in pagination (/page/2/ etc.)

Related links

Reproduction

example.zip

Steps to reproduce

  1. mkdocs serve
  2. View localhost:8000/page/2

Browser

Chrome

Before submitting

@squidfunk squidfunk added the needs investigation Issue must be investigated by the maintainers label Jul 15, 2023
@squidfunk
Copy link
Owner

I'm not able to reproduce the problem. The first problem is that your example is not runnable for us - it is far too big to be useful. However, I checked it on our own blog, and I'm unable to reproduce the behavior you're describing. The table of contents renders just fine on any page. For example, if I limit the number of posts to 2:

screenshot-localhost-8000-mkdocs-material-blog-page-2-1690890765816

If you're still experiencing the issue, please create a minimal reproduction, and we can look into it.

@squidfunk squidfunk added needs reproduction Issue lacks a minimal reproduction .zip file and removed needs investigation Issue must be investigated by the maintainers labels Aug 1, 2023
@jiegec
Copy link
Author

jiegec commented Aug 1, 2023

I have reduced to three posts, here's the new reproducer:

example.zip

@squidfunk
Copy link
Owner

This is still not a proper reproduction. There's additional JavaScript, some wavedrom snippets that we can't run, pages that don't seem to belong to the blog and are not relevant for this problem, etc.

Please remove everything that is not necessary to observe the problem. Thank you! 😊

@jiegec
Copy link
Author

jiegec commented Aug 1, 2023

Please check this one: example.zip

@squidfunk
Copy link
Owner

Finally reproducible, thanks you!

@squidfunk squidfunk added bug Issue reports a bug and removed needs reproduction Issue lacks a minimal reproduction .zip file labels Aug 1, 2023
@squidfunk squidfunk changed the title Blogging plugin does not generate table of contents in pagination Blog plugin missing integrated table of contents in pagination Aug 1, 2023
@squidfunk
Copy link
Owner

Okay, so this is actually tricky to fix, because the integrated table of contents will only be rendered for the currently active page. Since the paginated page is not part of the navigation, but essentially a shadow of the index page, the integrated table of contents is not rendered, This does not apply for the non-integrated table of contents which is rendered just fine.

We'll address this issue as part of the refactoring which we'll be doing shortly.

@squidfunk squidfunk reopened this Aug 1, 2023
@squidfunk squidfunk changed the title Blog plugin missing integrated table of contents in pagination Blog: missing integrated table of contents in pagination Aug 10, 2023
@squidfunk
Copy link
Owner

Resolved in 38b7282 – it's going to be released as part of 9.2.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Aug 21, 2023
@squidfunk
Copy link
Owner

Released as part of 9.2.0.

@fungaren
Copy link

Still unable to work. Have you retried it? @squidfunk

@squidfunk
Copy link
Owner

Yes, and it works. Your example structure is however wrong. You have blog_dirset to . which means the posts folder must be at docs/posts, not at docs/blog/posts. If you move the folder up, it works as expected:

screenshot-localhost-8000-page-2-1692869273161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants