diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/builder/base.py | 9 | ||||
-rw-r--r-- | app/builder/views.py | 5 | ||||
-rw-r--r-- | app/jrnl/build.py | 6 |
3 files changed, 19 insertions, 1 deletions
diff --git a/app/builder/base.py b/app/builder/base.py index 9ac8ec9..5c8c322 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -121,10 +121,19 @@ class BuildNew(): # write txt response = self.client.get('%s.txt' % url) self.write_file(path, response.content, ext='txt', filename=slug) + + + def build_amp_view(self): + ''' + Grab all the blog posts, render them to a template + string and write that out to the filesystem + ''' + for entry in self.get_model_queryset(): # write AMP response = self.client.get('%s.amp' % url) self.write_file(path, response.content, ext='amp', filename=slug) + def build_feed(self, url_name): """ Not called, but available for subclassing diff --git a/app/builder/views.py b/app/builder/views.py index fd62808..4fc6d6a 100644 --- a/app/builder/views.py +++ b/app/builder/views.py @@ -2,7 +2,7 @@ from django.shortcuts import render_to_response from django.template import RequestContext from builder.base import BuildWriting, BuildWritingFeed, BuildMap, BuildPhotos, BuildProjects, BuildSitemap, BuildPages from src.build import builder as src_builder -from jrnl.build import archive_builder, detail_builder, home_builder, rss_builder +from jrnl.build import archive_builder, detail_builder, home_builder, rss_builder, amp_builder from resume.build import builder as resume_builder from books.build import builder as book_builder from photos.build import builder as photo_builder @@ -49,6 +49,9 @@ def do_build(request): elif section == 'figments': context = {'message': 'Writing figments to Disk'} figments_builder() + elif section == 'buildamp': + context = {'message': 'Writing detail amp pages to Disk'} + amp_builder() else: options[section]().build() context = {'message': 'Writing %s to Disk' % section} diff --git a/app/jrnl/build.py b/app/jrnl/build.py index 872bc15..1bc5d3e 100644 --- a/app/jrnl/build.py +++ b/app/jrnl/build.py @@ -75,3 +75,9 @@ def home_builder(): def rss_builder(): j = BuildJrnl("jrnl", "entry") j.build_feed("jrnl:feed") + + +def amp_builder(): + j = BuildJrnl("jrnl", "entry") + j.build_amp_view() + |