posty.renderer package

Module contents

class posty.renderer.AtomRenderer(site, output_path='build')[source]

Bases: posty.renderer.feed.FeedRenderer

Renderer that outputs an Atom feed XML file

filename = 'atom.xml'
output()[source]

Output the Atom feed file

url()[source]

Return the URL to this feed file

class posty.renderer.HtmlRenderer(site, output_path='build')[source]

Bases: posty.renderer.base.Renderer

Renderer that outputs HTML files

render_page(page, template_name='page.html')[source]
Parameters:page – a Page object
render_post(post, template_name='post.html')[source]
Parameters:post – a Post object
render_posts(posts, prefix='', template_name='posts.html')[source]

Render a list of posts as sets of pages where each page has num_posts_per_page posts. Each page of posts will be rendered to the path page/:page/index.html relative to the Renderer output_path

If prefix is given, add that will be put in between the output_path and page path. For example if the prefix is ‘tags/foo/’ then a page path would look like ‘tags/foo/page/:page/index.html’

render_site()[source]

Given a Site object, render all of its components

Parameters:site – a loaded Site object
render_site_posts()[source]

Renders all of the multi-post pages, N per page

render_site_tags(template_name='posts.html')[source]

Renders all of the per-tag multi-post pages, N per page

class posty.renderer.JsonRenderer(site, output_path='build')[source]

Bases: posty.renderer.base.Renderer

Renderer that outputs a JSON representation of the Site to site.json within the output directory

render_site()[source]

Render the Site to site.json

class posty.renderer.RssRenderer(site, output_path='build')[source]

Bases: posty.renderer.feed.FeedRenderer

Renderer that outputs a RSS feed XML file

filename = 'rss.xml'
output()[source]

Output the RSS feed file

url()[source]

Return the URL to this feed file

class posty.renderer.Posty1RedirectRenderer(site, output_path='build')[source]

Bases: posty.renderer.base.Renderer

Renderer which creates pages to redirect old Posty1 URLs to new Posty2 URLs

Old Posty1 post URLs are in the form of: /:year/:month/:old_slug.html

Posty2 URLs are in the form of: /:year/:month/:slug/index.html

render_site()[source]