Skip to main content

An MkDocs plugin to generate '.pages' from 'pages.j2'

Project description

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_pages_j2_plugin-0.2.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_pages_j2_plugin-0.2.0-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page