posty.renderer package
Submodules
Module contents
- class posty.renderer.AtomRenderer(site: Site, output_path: str = 'build')[source]
Bases:
FeedRendererRenderer that outputs an Atom feed XML file
- filename = 'atom.xml'
- class posty.renderer.HtmlRenderer(site: Site, output_path: str = 'build')[source]
Bases:
RendererRenderer that outputs HTML files
- render_page(page: Page, template_name: str = 'page.html') None[source]
- Parameters:
page – a Page object
- render_post(post: Post, template_name: str = 'post.html') None[source]
- Parameters:
post – a Post object
- render_posts(posts: list[Post], prefix: str = '', template_name: str = 'posts.html') None[source]
Render a list of posts as sets of pages where each page has
num_posts_per_pageposts. Each page of posts will be rendered to the path page/:page/index.html relative to the Renderer output_pathIf
prefixis 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’
- class posty.renderer.JsonRenderer(site: Site, output_path: str = 'build')[source]
Bases:
RendererRenderer that outputs a JSON representation of the Site to
site.jsonwithin the output directory
- class posty.renderer.Posty1RedirectRenderer(site: Site, output_path: str = 'build')[source]
Bases:
RendererRenderer 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