Bases: pluggdapps.plugin.Plugin
A layout plugin to generate personal blog sites. Support create, gen, newpage interfaces APIs for corresponding sub-commands.
Creates a new layout under sitepath. Uses the directory tree under pagd:layouts/myblog as a template for the new layout. Accepts the following variable while creating,
Generate a static, personal blog site from the layout under sitepath. Note that previously a new-layout must have been created using this plugin and available under sitepath.
This method,
Refer to pages() method to know how pages are located under layout’s content-directory.
Pages are located based on filename, and the file extension is not used to differential pages. Hence there can be more than one file by same filename, like, _contents/hello-world.rst, _contents/hello-world.md. In such cases, all files will be considered as part of same page and translated to html based on the extension type.
Return a single element list of articles, each article as tuple. Refer to :class:Page class and its articles attribute to know its data-structure.
Gathers default context for page.
Default context is specified by one or more JSON files by name _context.json that is located under every sub-directory that leads to the page-content under layout’s content-directory. _context.json found one level deeper under content directory will override _context.json found in the upper levels.
Also, if a pagename has a corresponding JSON file, for eg, <layout>/_contents/path/hello-world.rst file has a corresponding <layout>/_contents/path/hello-world.json, it will be interepreted as the page’s context. This context will override all the default context.
If _xcontext attribute is found in a default context file, it will be interpreted as plugin name implementing IXContext interface. The plugin will be queried, instantiated, to fetch context information from external sources like database.
Finally last_modified time will be gathered from content-file’s mtime statistics.
Individual pages are picked based on the relative directory path along with filenames. Note that file extensions are not used to differentite pages, they are only used to detect the file type and apply corresponding translation algorithm to get page’s html.
For every page that pages() method iterates, a corresponding template file should be located. It is located by following steps.