Liquid Tags Pelican Plugin

Posted on Fri 10 July 2020 in Dev Resources

Cover image
Image by Vansh Juneja

Pelican has some nice plugins. The liquid tag plugin is no exception. I found the documentation confusing for how to tag images so I wanted to find some examples instead. Found a PR with some examples.

Liquid tags handle the formatting but we need a different plugin if we want to use relative references to our media. I wrote some notes down about the plugin pelican-autostatic to accomplish that.

pelican auto static example

![Cactus Image]({static ./img/cactus100.jpg})

Liguid tag for inserting image with original size

{% img {static|./img/cactus100.jpg} %} 

Liguid tag for inserting image with specific size

{% img /url/to/image.png [width] [height] [title] [alt] %}

Insert HTML5/flash compatible videos:

{% video /url/to/video.mp4 [width] [height] [title] %}

Insert code from a file, with a title and link to download:

{% include_code filename [title] %}

Insert an HTML-rendered ipython notebook:

{% notebook filename.ipynb [cells[start:end]] %}