posty.renderer.html module¶
-
class
posty.renderer.html.
HtmlRenderer
(site, output_path='build')[source]¶ Bases:
posty.renderer.base.Renderer
Renderer that outputs HTML files
-
prepare_content
()[source]¶ 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_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_pathIf
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
Renders all of the per-tag multi-post pages, N per page
-