summaryrefslogtreecommitdiff
path: root/app/figments/build.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2015-11-01 21:16:42 -0500
committerluxagraf <sng@luxagraf.net>2015-11-01 21:16:42 -0500
commit47ab118686d3216598b57188a67c81f9cf169c50 (patch)
treedf1deec3a59d13115bb4b09c042345c0354b68dd /app/figments/build.py
parente8d1fa3f47f8520618bd83dd917c569c83f2de86 (diff)
added epub script basics and styled figments archives and details
Diffstat (limited to 'app/figments/build.py')
-rw-r--r--app/figments/build.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/figments/build.py b/app/figments/build.py
index b0890fd..58835e5 100644
--- a/app/figments/build.py
+++ b/app/figments/build.py
@@ -2,11 +2,12 @@ from builder.base import *
from .models import Figment, Series
-class BuildSrc(Build):
+class BuildFigments(Build):
def build(self):
self.build_archive()
self.build_topic_archive()
self.build_detail_pages()
+ self.build_detail_epub()
self.build_feed()
def build_detail_pages(self):
@@ -21,6 +22,18 @@ class BuildSrc(Build):
s = render_to_string('details/note.txt', c).encode('utf-8')
self.write_file(path, s, 'txt', entry.slug)
+ def build_detail_epub(self):
+ '''
+ Grab all the notes, render them to a template string and write that out to the filesystem
+ '''
+ for entry in Figment.objects.filter(status__exact=1):
+ c = Context({'object': entry, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL, 'SITE_URL':settings.SITE_URL})
+ t = render_to_string('details/fignments.html', c).encode('utf-8')
+ path = 'figments/'
+ self.write_file(path, t, 'html', entry.slug)
+ s = render_to_string('details/note.txt', c).encode('utf-8')
+ self.write_file(path, s, 'txt', entry.slug)
+
def build_archive(self):
path = 'figments/'
c = Context({