-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
documentation error: pages not list of page objects, but of file objects #1736
Comments
The documentation is correct in that it describes the expected behavior. If the |
It seems that "pages" are file-object. I tried to use the "pages" collection on my project : Using pages as page-objects : <h3>Pages</h3>
<ul>
{% for item in pages %}
<li>{{ item.title }}</li>
{% endfor %}
</ul> Using pages as file-objects : <h3>Pages</h3>
<ul>
{% for item in pages %}
<li>{{ item.page.title }}</li>
{% endfor %}
</ul> Using MkDocs on windows with "serve" command with version : mkdocs, version 1.1.2 from [...]\Python39\site-packages\mkdocs (Python 3.9) |
After reviewing the code, yes the documentation is wrong. There is no "pages" collection. It seems the variable name was poorly chosen. Perhaps we should alias it as |
Took another look at this. The name |
The documentation about "pages" on https://www.mkdocs.org/user-guide/custom-themes/ is wrong.
It says:
But in reality, pages is a list of file-objects, which also contain the page objects.
The page-object can be accessed by pages[i].page.
The text was updated successfully, but these errors were encountered: