|
|
|
|
|
by prewett
4527 days ago
|
|
Is there something like this that operates at a higher level? Unlike the author, I'm ok with HTML (and I can't stand markdown), except that it's too low level. I want to break things up by title, author, date, summary, content, etc. and then generate the HTML by plugging it into a template, so that title, date, and author become part of the heading at the top of the page and so on. So something like <title>...</title> (pretend this isn't already taken)
<author>...</author>
<date>...</date>
<summary>...</summary>
... It seems like XSLT is what I want, except that I have to deal with a bunch of XML nonsense. I could always write my own parser, but I keep hoping someone already wrote something like this. |
|
You can read about jinja2 template inheritance in their docs [1]. The gist of it is that you can define a layout in HTML, with placeholders for specific things like the title, author, content, etc. Then your actual post is just a file that inherits from that layout template and only defines the relevant blocks. So in "template pseudocode" your page might look like this:
[1]: http://jinja.pocoo.org/docs/templates/#template-inheritance