posty.page module

class posty.page.Page(title: str, body: str, slug: str = '', parent: str | None = None, _config: Config | None = None)[source]

Bases: Model

Representation of a page

body: str
classmethod from_yaml(file_contents: str, config: Config | None = None) Page[source]

Return a Page from the given file_contents

parent: str | None = None
path_on_disk() str[source]

Returns the relative path on disk to the object, for rendering purposes

slug: str = ''
title: str
to_yaml() str[source]

Returns a string of the YAML and text representation of this Post. This is the reverse of from_yaml

url() Any[source]

Returns the URL path to this resource

validate() None[source]

Validate that the page is correct.

Raises:

InvalidObject