posty.site module¶
-
class
posty.site.
Site
(site_path='.', config_path=None)[source]¶ Bases:
object
Representation of an entire site with posts and pages. This is the main class that conrols everything.
Parameters: - site_path – Path to the directory containing site content (pages, posts, templates)
- config_path – Path to the config file, defaults to
$SITE_PATH/config.yml
-
config
¶ Returns this site’s config as read from the config file
-
copyright
¶ Returns a string of the copyright info, based on the configured author and the years of the first and last post
-
page
(slug)[source]¶ Returns a Page object by its slug
Parameters: slug – slug of the page to find Returns: A page dict Raises: PostyError – if no page could be found
-
post
(slug)[source]¶ Returns a Post object by its slug
Parameters: slug – slug of the post to find Returns: A post dict Raises: PostyError – if no post could be found