gilbert.content module

Content object classes

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

Bases: gilbert.schema.Schema

Base content class.

content
content_type
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
class gilbert.content.Page(name, site, data=None, meta=None)

Bases: gilbert.content.Templated, gilbert.content.Content

A templated Page content type.

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

Bases: gilbert.content.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
render()
class gilbert.content.Renderable

Bases: object

Mixin to simplify making renderable content types.

output_extension = 'html'
output_filename
page_content
render()
url
class gilbert.content.Templated

Bases: gilbert.content.Renderable

Definition and implementation of the Templated interface.

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