{{ item.title }}
{% endif %} + + {{ item.content }} + ++ by {{ item.channel_author }} on + {{ item.date }} ยท + permalink +
+diff --git a/planet/shell/dj.py b/planet/shell/dj.py new file mode 100644 index 0000000..d728313 --- /dev/null +++ b/planet/shell/dj.py @@ -0,0 +1,30 @@ +import os.path +import urlparse + +from planet import config +from tmpl import template_info + +def run(script, doc, output_file=None, options={}): + """process a Django template file """ + + # this is needed to use the Django template system as standalone + # I need to re-import the settings at every call because I have to + # set the TEMPLATE_DIRS variable programmatically + from django.conf import settings + settings.configure( + DEBUG=True, TEMPLATE_DEBUG=True, + TEMPLATE_DIRS=(os.path.dirname(script),) + ) + from django.template import Context + from django.template.loader import get_template + + context = Context() + context.update(template_info(doc)) + + reluri = os.path.splitext(os.path.basename(output_file))[0] + context['url'] = urlparse.urljoin(config.link(),reluri) + + t = get_template(script) + f = open(output_file, 'w') + f.write(t.render(context)) + f.close() diff --git a/themes/django/bland.css b/themes/django/bland.css new file mode 100644 index 0000000..f24e8b6 --- /dev/null +++ b/themes/django/bland.css @@ -0,0 +1,39 @@ +body { + margin: 50px 60px; + font-family: Georgia, Times New Roman, serif; +} + +h1 { + font: normal 4em Georgia, serif; + color: #900; + margin-bottom: 0px; +} + +.updated, .entry-tools { + font: .8em Verdana, Arial, sans-serif; + margin-bottom: 2em; +} + +#channels { + float: right; + width: 30%; + padding: 20px; + margin: 20px; + margin-top: 0px; + border: 1px solid #FC6; + background: #FFC; +} + +#channels h2 { + margin-top: 0px; +} + +#channels ul { + margin-bottom: 0px; +} + +.entry { + border-top: 1px solid #CCC; + padding-top: 1em; +} + diff --git a/themes/django/config.ini b/themes/django/config.ini new file mode 100644 index 0000000..e44023c --- /dev/null +++ b/themes/django/config.ini @@ -0,0 +1,11 @@ +# This theme is an example Planet Venus theme using the +# Django template engine. + +[Planet] +template_files: + index.html.dj + +template_directories: + +bill_of_materials: + bland.css diff --git a/themes/django/index.html.dj b/themes/django/index.html.dj new file mode 100644 index 0000000..57f9a81 --- /dev/null +++ b/themes/django/index.html.dj @@ -0,0 +1,49 @@ + + +
++ last updated by Venus + on {{ date }} on behalf of {{ author_name }} +
+ ++ by {{ item.channel_author }} on + {{ item.date }} ยท + permalink +
+