Skip to content

How to generate a custom index page with a TOC listing specific meta data for each page? #8259

Answered by venthur
venthur asked this question in Q&A
Discussion options

You must be logged in to vote

Errata to the previous message. you're looping over page in pages, but as per the context creation above and MkDocs documentation pages is a list of File objects pages=files. So page.meta won't work, as File doesn't have this attribute. The correct access would look like page.page.meta inside the loop. Just a mention, because it would still be empty, unless...

I think this is it! page.page.meta exists and seems to contain everything i need. So I think I can continue with my initial approach and don't have to use hooks in the first place.

Thanks a lot, I learned a lot about the way mkdocs processes pages.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@venthur
Comment options

@kamilkrzyskow
Comment options

Comment options

You must be logged in to vote
5 replies
@kamilkrzyskow
Comment options

@venthur
Comment options

@kamilkrzyskow
Comment options

@venthur
Comment options

@kamilkrzyskow
Comment options

Answer selected by kamilkrzyskow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants