Skip to content

Site

Site

The site stores your pages and collections to be rendered.

Pages are stored in :py:attr:routes and created with site.render(). Collections and subcollections are stored to be used for future use.

Sites also contain global variables that can be applied in templates.

engine: typing.Type[Environment] = Environment(loader=FileSystemLoader('templates')) class-attribute

Engine to generate web pages

path: Path = Path('output') class-attribute

Path to write rendered content.

render_collection(collection)

Add a class to your self.collections iterate through a classes content_path and create a classes Page-like objects, adding each one to routes.

Use a decorator for your defined classes.

Examples::

@register_collection
class Foo(Collection):
    pass

render_page(page)

Create a Page object and add it to self.routes

render_static(directory)

Copies a Static Directory to the output folder