OpenLiveWriter/docs/Hacking - Static Site Clien...

2.3 KiB

Hacking - Static Site

The Static Site Generator support is split into various classes, as indicated by the class diagram below.

Please note that this diagram only describes classes created as part of the Static Site Generator implementation, and only classes in the OpenLiveWriter.BlogClient.Clients.StaticSite namespace. Other classes are implemented, such as wizard pages, which have been ommited from the above diagram.

Class roles and descriptions

Name Role and description Dependency summary
StaticSiteClient Serves as the primary interface between Open Live Writer and the Static Site Generator support. Implements Blog functions such as CRUD on posts and pages.
  • Implements IBlogClient
  • Inherits BlogClientBase
  • Creates a private StaticSiteConfig and loads its contents from the provided IBlogClientCredentialsAccessor on initiation.
StaticSiteConfig Defines and handles the storage and processing of configuration settings for the Static Site Generator support.
  • Instantiated in StaticSiteClient
  • Used-by-reference in StaticSiteConfigDetector.
  • Instantiates a StaticSitePostFrontMatterKeys, to be loaded from stored config values.
StaticSitePost Represents a published or yet-to-be-published post to StaticSiteClient. Contains methods related to loading from disk, saving to disk, and generating safe on-disk slugs and IDs, as well as other functionality.
  • Contains a BlogPost (from OpenLiveWriter.Extensibility.BlogClient)
  • Generates a StaticSitePostFrontMatter on attribute request
StaticSitePostFrontMatter Defines and stores all possible static post front matter keys. Implements loading and saving from YAML, as well as loading and saving from a OpenLiveWriter.Extensibility.BlogClient.BlogPost instance.
  • Instantiated by StaticSitePost on request.
  • Retrieves and stores a StaticSitePostFrontMatterKeys from StaticSiteConfig on construction.
StaticSitePostFrontMatterKeys A subset of the static site config, StaticSitePostFrontMatterKeys contains the key names for each of the supported front-matter attributes. Used to support different static site generators.
  • Instantiated by StaticSiteConfig.
  • Used-by-reference in StaticSitePostFrontMatter