Skip to content

joachimneu/pelican-jinja2content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This repository is unmaintained and out of date, use the jinja2content plugin shipped with pelican-plugins instead!

pelican-jinja2content

This Pelican plugin uses the Jinja2 template engine used by Pelican to render the content of articles. This allows the use of Jinja2 template code in articles, and thus provides access to for example the extremely useful include or import statements of Jinja2 from within articles.

Installation

Clone this repository into a pelican-jinja2content directory inside the plugins directory of your Pelican project (or whatever directory you specified for plugins in Pelican's PLUGIN_PATHS setting) and add 'pelican-jinja2content' to the list of plugins (Pelican setting PLUGINS) of your project. Or just use it as part of pelican-plugins.

Usage

Simply use Jinja2 template code in your articles. If you want to use custom template files for Jinja2's include or import, place them into the templates folder of your theme.

Known Issues

  • As Markdown's attr_list extension in extra uses {: ...} to specify additional HTML attributes for the content to be rendered by Markdown, but also allows for plain { ... } notation, this might conflict with eventual Jinja2 template code you supply in your articles. An easy fix is to remove the attr_list extension for Pelican's MD_EXTENSIONS settings variable (remove 'extra' and add all extensions in extra manually except from attr_list).

Warranty

No warranty whatsoever is provided for this code. Use only at your own risk!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages