MkDocs Pagetree Plugin

MkDocs plugin that allows you to display the page tree. Like sitemap.xml, but for humans.

Options

The following tree options for the pagetree marker exists:

  • {{ pagetree(all) }}

    Render the whole pagetree. This is the default tree option, the (all) parameter can also be omitted.

  • {{ pagetree(children) }}

    Render only direct children of the current page

  • {{ pagetree(siblings) }}

    Render only direct siblings of the current page, excluding the current page

  • {{ pagetree(subtree) }}

    Render the subtree which contains the current page

Notes

  • The plugin or marker can be used on several pages.
  • Only the first occurrence of the marker {{ pagetree }} on a page is replaced.
  • If any page status is used (Ref), allow filtering the pagetree for these statuses.
  • If no page with the status attribute exists, the filter will not be rendered.

Demo

Code

# docs_dir/file.md

{{ pagetree }}

Rendered