aboutsummaryrefslogtreecommitdiffstats
path: root/docs/theming.txt
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2013-01-02 08:35:03 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2013-01-02 08:35:03 -0300
commit9c5708cc92af894e414bc76ee35ec2230de5d288 (patch)
tree61bd56b5517a4713626c254981143e008c719469 /docs/theming.txt
parent0f2c04e70a0ffdd0892d6970cafbcd952d221db5 (diff)
Imported Upstream version 5.1upstream/5.1
Diffstat (limited to 'docs/theming.txt')
-rw-r--r--docs/theming.txt23
1 files changed, 14 insertions, 9 deletions
diff --git a/docs/theming.txt b/docs/theming.txt
index 93c7824..33884e9 100644
--- a/docs/theming.txt
+++ b/docs/theming.txt
@@ -8,6 +8,9 @@ Theming Nikola
.. contents::
+This document is a reference about themes. If you want a tutorial, please read
+`Creating a Theme <creating-a-theme.html>`_
+
The Structure
-------------
@@ -69,20 +72,15 @@ bundles
Templates should use either the bundle or the individual files based on the ``use_bundles``
variable, which in turn is set by the ``USE_BUNDLES`` option.
-Creating a New Theme
---------------------
-
-In your site's folder, create a ``themes`` folder. Choose a theme to start from, and
-create ``themes/yourthemename/parent`` as a file containing the parent theme's name.
-There, you just created a new theme. Of course it looks exactly like the other one,
-so let's customize it.
-
Templates
---------
In templates there is a number of files whose name ends in ``.tmpl``. Those are the
theme's page templates. They are done usig the `Mako <http://makotemplates.org>`_
-template language. If you want to do a theme, you should learn the Mako syntax first.
+or `Jinja2 <jinja.pocoo.org>`_ template languages. If you want to do a theme, you
+should learn one first. What engine is used by the theme is declared in the ``engine`` file.
+
+The rest of this document explains Mako templates, but Jinja2 is fairly similar.
Mako has a nifty concept of template inheritance. That means that, a
template can inherit from another and only change small bits of the output. For example,
@@ -183,6 +181,13 @@ list.tmpl
* ``items``: a list of (text, link) elements.
+
+list_post.tmpl
+ Template used to display generic lists of links. Can use everything ``base.tmpl`` uses, plus:
+
+ * ``posts``: a list of Post objects.
+
+
You can add other templates for specific pages, which the user can the use in his ``post_pages``
option in ``dodo.py``. Also, keep in mind that your theme is yours, there is no reason why
you would need to maintain the inheritance as it is, or not require whatever data you want.