This repository has been archived on 2023-09-18. You can view files and clone it, but cannot push or open issues or pull requests.
blogtopoid/doc/source/templates.rst

74 lines
1.3 KiB
ReStructuredText

Templates
=========
Structure
---------
A blogtopoid template consists of three Jinja2 files:
* index.html
Used for generating the landing page and tag listings.
* post.html
Used for generating a post view.
* page.html
Used for generating a page view.
Variables
---------
Each template gets passed a few variables by blogtopoid.
**Common for all template files:**
*config*
A config object.
Useful properties are:
*blogtitle*
The blogs title
*blogdescription*
The blogs short description
*blogurl*
The blogs (base) URL
*pages*
A list of all blog pages.
**index.html only:**
*body*
The preformatted page body.
**post.html & page.html only:**
*add_style*
Additional CSS directives, currently only generated by rST files.
*post*
The current Post (resp. Page) object.
Useful properties are:
*date*
(Post only, not in Page) The posts date
*title*
The Posts/Pages title
*body*
The preformatted post/pages body.
CSS & Co
--------
Drop CSS files and additional needed files (fonts, images) into your
configured styledir/.
All non-CSS contents will be copied to outputdir/style/.
CSS files will be concatenated, minimised, and copied to outputdir/style/style.css
and can be loaded from templates by including::
<link rel="stylesheet" href="{{ config.blogurl }}style/style.css">
in the <head> section.