Closed
Description
Contribution guidelines
- I've read the contribution guidelines and wholeheartedly agree
I've found a bug and checked that ...
- ... the problem doesn't occur with the
mkdocs
orreadthedocs
themes... the problem persists when all overrides are removed, i.e.custom_dir
,extra_javascript
andextra_css
... the documentation does not mention anything about my problem... there are no open or closed issues that are related to my problem
Description
With toc.integrate
enabled, blog posts do not have a table of contents.
Expected behaviour
Preferably, the table of the contents should appear on the left side of the blog post, above author information and metadata.
Actual behaviour
Blog posts lack a TOC, appearing neither left or right.
Steps to reproduce
Enable toc.integrate
within mkdocs.yml
Package versions
- Python:
3.11
- MkDocs:
Insiders commit 78de2df
- Material:
1.4.2
Configuration
features:
- toc.integrate
System information
- Operating system: Windows 11
- Browser: Firefox
Metadata
Metadata
Assignees
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
squidfunk commentedon Dec 10, 2022
Thank for reporting. Yes, that's not currently not supported, because there's no place where the table of contents can live in the navigation. I'm not sure how it should behave. We could exempt the integration logic for blog posts, but that would kind of be inconsistent.
tylernguyen commentedon Dec 10, 2022
Preferably, I would want for the TOC to live above author and metadata info on the left. There is too much white space on the left. Something of this order:
Hopefully, this isn't too hard to integrate. But if it is, I guess the ability to example integration logic for blog posts can be a temporary fix until a better solution is thought of.
squidfunk commentedon Dec 10, 2022
Hmm, it would visually likely deviate from the current integration in the navigation, as there's no top-level navigation item to position it under. I'll evaluate this, but I can't give a guarantee that this will be implemented eventually.
squidfunk commentedon Dec 12, 2022
So turns out – it's not trivial. Adding it to the left sidebar, which is a third sidebar will induce several problems. Thus, I've disabled
toc.integrate
for blog posts, for now in1f0c8baec
. This may change in the future. The blog post templates are definitely going to be revamped at some point, the current version being the first iteration. Your feedback is very valuable and it will be considered when I work on the blog templates again.tylernguyen commentedon Dec 13, 2022
The latest commit seems to disable
toc.integrate
universally. Can you please double check so that it only disablestoc.integrate
for blog posts? As I still very much love the layout, styling, and spacing thattoc.integrate
gives me.squidfunk commentedon Dec 14, 2022
Oh, thanks for noting. I'll take a look.
squidfunk commentedon Dec 14, 2022
I've reverted the changes in
ee12d9f95
, as this needs some more thought. I assumed that MkDocs would create fresh copies of the configuration to pass to the templates, and this configuration is immutable, but it isn't. This also means that you can probably change values from the templates themselves. I may have a better idea how to solve this problem.squidfunk commentedon Jan 8, 2023
Fixed in
f5b77bf23
. The table of contents is now moved to the left whentoc.integrate
is enabled. I'll revisit the blog layout and sidebar later this year, trying to improve the current situation. However, this can be considered fixed for now:squidfunk commentedon Jan 8, 2023
Released as part of 9.0.3+insiders-4.27.1.