Skip to main content

mkdocs-pages-j2-plugin

This plugin builds .pages files from .pages.j2 files, using Jinja2 to render the templates. This plugin is particularly useful when used together with the mkdocs-awesome-pages-plugin.

Installation

Install the package with pip:

pip install mkdocs-pages-j2-plugin

Activate the plugin in mkdocs.yml:

plugins:
  - search
  - pages-j2
  - awesome-pages

Configuration

The plugin can be configured in the plugins section of mkdocs.yml as follows:

plugins:
  ...
  - pages-j2:
      use_extra: true
  ...

If use_extra is set to true (the default), the plugin will use the extra section of mkdocs.yml as context for rendering the templates. Otherwise, the plugin will use the full configuration.

Note that this feature has been added in version 0.3.0 and is a breaking change from version 0.2.x. Set use_extra to false if you want the same behaviour as in pre 0.3.0 versions.

Usage

Example of a .pages.j2 file:

title: Page Title
nav:
    - Welcome: index.md
{%- for i in range(1,3) %}
    - My Page {{ i }}: p{{ i }}.md
{%- endfor %}

The plugin will render the Jinja2 template above and create a .pages file with the following content:

title: Page Title
nav:
    - Welcome: index.md
    - My Page 1: p1.md
    - My Page 2: p2.md

Metadata

Release files for mkdocs-pages-j2-plugin 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-pages-j2-plugin 0.3.1
File Size Uploaded Provenance
mkdocs_pages_j2_plugin-0.3.1.tar.gz 2.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-pages-j2-plugin 0.3.1
File Interpreter ABI Platform
mkdocs_pages_j2_plugin-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / mkdocs_pages_j2_plugin-0.3.1.tar.gz

Download URL mkdocs_pages_j2_plugin-0.3.1.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fe69d54d831046c3ad1ae4fd8f686d835014271c5a785b7b9acf65da1348e4f9
BLAKE2b-256 checksum
How to use checksums
4b95ee264313670cf085966ff87f38b85834f5e11d596993b762a33a082f8af6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / mkdocs_pages_j2_plugin-0.3.1-py3-none-any.whl

Download URL mkdocs_pages_j2_plugin-0.3.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efa0789b15870360eb61a9eac72bf5d48f99f98e03d6c921db114078d8428ac4
BLAKE2b-256 checksum
How to use checksums
9d7cc5daa2128eda784b1f5fe05979b8f8bb26ce6416c3e42ee8b2a9413ef115
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8

Security for mkdocs-pages-j2-plugin 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page