Exemple #1
0
 def s3_page_dict(self):
     """
     Returns a dictionary whose keys are the S3 bucket keys
     and values are the HTML to be written.
     """
     pages = {}
     for page in self.pages.values():
         pages[page.s3_key] = render(self, page)
     return pages
Exemple #2
0
 def render_path(self, path):
     """
     Return HTML for a given a URL fragment (ex: /services/django).
     If that page doesn't exist, None is returned.
     """
     try:
         self.reload_pages()
         return render(self, self.pages[path])
     except KeyError:
         return None
Exemple #3
0
 def html_page_dict(self):
     """
     Returns a dictionary whose keys are the relative filesystem paths
     for each page's HTML output and values are the HTML to be written.
     """
     pages = {}
     for page in self.pages.values():
         pages[page.html_path] = render(self, page)
     return pages