diff options
author | luxagraf <sng@luxagraf.net> | 2015-01-25 18:48:19 +0000 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2015-01-25 18:48:19 +0000 |
commit | 07dc722b5b244a21fbb8aa4e0bdafb53e1598330 (patch) | |
tree | be313cae0d0d1ecc049f0c9610de8a1e40a0cdba /app/builder/base.py | |
parent | 6eb3a9c2ab19b44d330c583d35cde85e965f899d (diff) |
fixed homepage builder
Diffstat (limited to 'app/builder/base.py')
-rw-r--r-- | app/builder/base.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/builder/base.py b/app/builder/base.py index 0b92832..b18e8be 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -140,8 +140,9 @@ class BuildWriting(Build): def build_homepage(self): obj = get_model('blog', 'homepagecurrator').objects.get(pk=1) + recent = get_model('blog', 'entry').objects.filter(status__exact=1)[:3] template = obj.template_name - c = Context({'homepage': obj, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) + c = Context({'homepage': obj, 'recent': recent, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) t = render_to_string(template, c).encode('utf-8') self.write_file('', t) @@ -270,8 +271,8 @@ class BuildPages(Build): t = render_to_string(["details/%s.html" % page.slug, 'details/page.html'],c).encode('utf-8') s = render_to_string('details/page.txt',c).encode('utf-8') fpath = '%s' %(page.slug) - self.write_file(fpath,t) - self.write_file(fpath,s,'txt') + self.write_file('', t, 'html', page.slug) + self.write_file('', t, 'txt', page.slug) class BuildMap(Build): def build(self): |