Exemple #1
0
    def make_entry(self, el, entry):
        child_el = ElementTree.SubElement(el, 'title')
        child_el.text = self.entry_title(entry)

        child_el = ElementTree.SubElement(el, 'updated')
        child_el.text = self.entry_updated(entry).strftime(self._RFC3339)

        uri = self.entry_uri(entry)

        child_el = ElementTree.SubElement(el, 'id')
        child_el.text = uri

        child_el = ElementTree.SubElement(el, 'link', {
            'rel': 'alternate',
            'type': 'text/html',
            'href': uri,
        })

        child_el = ElementTree.SubElement(el, 'content', {'type': 'html',})
        child_el.text = render(self.content_template, {'entry': entry,})
Exemple #2
0
def direct_to_file(static_file, template, context=None):
    static_file.content = render(template, context)
Exemple #3
0
def photo(static_file, album_slug, slug):
    static_file.content = render('/gallery/photo.html', {
        'photo': models.album(album_slug).photo(slug),
    })
Exemple #4
0
def album(static_file, slug):
    static_file.content = render('/gallery/album.html', {
        'album': models.album(slug),
    })
Exemple #5
0
def albums(static_file):
    static_file.content = render('/gallery/albums.html', {
        'albums': models.albums(),
    })
Exemple #6
0
def article(slug):
    return StaticFile(render('/blog/article.html', {
        'article': models.article(slug),
    }))