crotal.site.
Site
(path, full=False, output=u'preview')[source]¶Site is an abstraction of a Crotal site.
Example usage:
true
to do a full build, false
to do an
incremental build.None
generate
()¶Generate the site, first render the templates, then write the rendered
files in the output path, then save the database json file db.json
.
parse_single_file
(file_path, event_type)¶This method is used when single file change was detected during the server running.
When a single file is modified, created or deleted, the crotal server calls
this function and pass the file_path
and event_type
into it. Then the
model(e.g. Post or Page or Template) of the file will be found based on
file_path
and model will be called to react to the file change, and the
output will be rewrite.
modified
, created
or
deleted
.None
detect_file_type
(file_path)¶Decide which model the file belongs to.
model
that the file belongs to.render
()¶Render the content of the site based on templates. :return: None
write
()¶Write the site content based on self.site_content
.
save
()¶Save the database content into db.json
.
:return: None