tumblelog comes with a set of basic templates that should be used as a basis for you to build your own.
In all tumblelog views, the following context variables are always available:
The following templates are used aspecifically to post types.
This template is used to display a list of Post objects.
{% load i18n %}
{% if posts %}
{% for post in posts %}
{% include 'tumblelog/post.html' %}
{% endfor %}
{% else %}
{% blocktrans %}
<p>There are no public posts. Get writing! This blog won't author itself. That functionality is coming in v2.0.</p>
{% endblocktrans %}
{% endif %}
{% include 'tumblelog/pagination.html' %}
This template is used in a single Post object’s detail view.
{% block main %}
{% include "tumblelog/post.html" %}
{% endblock main %}
This template is intended to be used any time a Post object is displayed. It should be used as an include in both the post_list.html and post_detail.html templates.
<article class="{{ post.post_type_name }}">
<header>
<h2><a href="{{ post.get_absolute_url }}">{{ post.fields.title }}</a></h2>
<time pubdate="pubdate" datetime="{{ post.date_published|date:"m-d-Y" }}">{{ post.date_published|date:"F j, Y" }}</time>
</header>
{% include post.fields.post_template %}
</article>
As each post type has a unique schema and intended usage, each one requires its own set of templates. The name of each template is derived from a slugified version of its class name, using Django’s slugify function.
This template is used to display the body of posts of this type.
This example is from the article post type, located at tumblelog/post/article.html.
{% load i18n %}
{% if detail_view %}
{{ post.fields.body|linebreaks }}
{% endif %}
{% if list_view %}
{{ post.fields.excerpt|linebreaks }}
<footer>
<p><a href="{{ post.get_absolute_url }}">{% trans "Read More" %}</a></p>
</footer>
{% endif %}
This template is used to display the body of posts of this type in the RSS feed. If this file does not exist, the post type template is used.
tumblelog does not come with any RSS templates. This examples shows what a template for the article post type might look like, if you only wanted to show the excerpt. This template would be located at tumblelog/rss/article.html.
{{ post.fields.excerpt|linebreaks }}
<p><a href="{{ post.get_absolute_url }}">{% trans "Read More" %}</a></p>