Pelican: How to define the layout of each page similar to Jekyll?

Asked

Viewed 80 times

1

I use Jekyll in my website, I’ll stop using for this reason. I wanted to migrate to the Pelican but I’m stuck in layouts. Here’s the problem:

In Jekyll I can on each page (page) define the layout, or better, say (point) what will be the layout, Ex:

foo1.md
---
layout: modelo-a
---

foo2.md
---
layout: modelo-b
---

foo3.md
---
layout: modelo-c
---

I didn’t figure out how to do this in the Pelican, someone knows how?

That configuration variable TEMPLATE_PAGES...

TEMPLATE_PAGES = {'src/books.html': 'dest/books.html',
              'src/resume.html': 'dest/resume.html',
              'src/contact.html': 'dest/contact.html'}

... does not suit me because I have more than 100 pages and the number is growing, imagine how would the business!

1 answer

1


The page template can be chosen along with the rest of the page metadata, like:

Title: Meu Artigo
Date: 2014-09-18 10:20
Modified: 2014-09-18 18:40
Tags: opiniao, tecnologia
Category: artigos
Slug: meu-artigo
Authors: Flavio Micheletti
Summary: Como especificar o template em cada página do Pelican
Template: modelo-a

Para escolher o template em cada página você precisa...
  • Hi Sergio, thanks for the reply. I will test and if everything goes well, I come back here to close the topic.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.