posty.renderer.html module

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

Bases: posty.renderer.base.Renderer

Renderer that outputs HTML files


Do a first-pass rendering of each post and page text, treating the text as Jinja2 templates. This lets us use basic jinja in the markdown to be able to use filter functions like this:

{{ "img/cool_pic.jpg" | media_url }}

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’


Given a Site object, render all of its components

Parameters:site – a loaded Site object

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


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