gilbert.content module

Content object classes

class gilbert.content.Content(name, site, data=None, meta=None)

Bases: Schema

Base content class.

property content: str
content_type: str
classmethod create(name, site, data, meta)

Create a new Content instance.

Will extract the content type from the meta, and create the appropriate sub-class.

tags: Collection[str]
class gilbert.content.Page(name, site, data=None, meta=None)

Bases: Templated, Content

A templated Page content type.

class gilbert.content.Raw(name, site, data=None, meta=None)

Bases: Content

Container for ‘raw’ data.

Unlike other content types, does not hold its data - only the path to the source. Upon render, it copies the source file directly to the target.

path: Path
render()
class gilbert.content.Renderable

Bases: object

Mixin to simplify making renderable content types.

name: str
output_extension: str = 'html'
property output_filename: Path
property page_content
render()
property url: str
class gilbert.content.Templated

Bases: Renderable

Definition and implementation of the Templated interface.

get_context()
get_template()
get_template_names() Sequence[str]
property page_content
render()
template: str | Sequence[str] = 'default.html'