How can I override the default template used by a page or article in a pelican?

I would like to know how to use another template for a page or article in a pelican?

Until now, it seems that article.html used for articles and page.html .

+7
python pelican
source share
2 answers

You can set the name of the output file using the Template metadata in your individual files. This will override the default value specified in the configuration file.

For Markdown, you should include this in your header:

  Template: template_name 

This is discussed in the FAQ on the Pelican website.

+6
source share

Pelican looks for patterns in any directory that you specify as THEME in your pelicanconf.py . If you just want to change the appearance of the output, you can change article.html or page.html in this directory (by default it is themes/notmyidea relative to where the pelican is installed). See how to create themes for Pelican for more.

If you really want to change the name of the file that Pelican is looking for to create articles or pages, this is a little more complicated. I don’t know any settings that allow you to change this, but the corresponding Pelican source bit looks here , so if you really want you to consider subclassing Content yourself, simply changing the corresponding lines in your copy of the Pelican.

+1
source share

All Articles