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

2.6 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 StaticSiteConfigFrontMatterKeys, to be loaded from stored config values.
StaticSiteItem Abstract class which represents a published or yet-to-be-published generic item to StaticSiteClient. Contains methods related to loading and saving, as well as generic methods which are based upon through sub-classes.
  • Contains a BlogPost (from OpenLiveWriter.Extensibility.BlogClient)
  • Generates a StaticSiteItemFrontMatter on attribute request
  • Abstract class, never instantiated.
StaticSitePost Sub-class of StaticSiteItem representing a Post item. Sub-classes StaticSiteItem
StaticSitePage Sub-class of StaticSiteItem representing a Page item. Sub-classes StaticSiteItem
StaticSiteItemFrontMatter Defines and stores all possible static item front matter keys. Implements loading and saving from YAML, as well as loading and saving from a OpenLiveWriter.Extensibility.BlogClient.BlogPost instance.
  • Instantiated by StaticSiteItem on request.
  • Retrieves and stores a StaticSiteConfigFrontMatterKeys from StaticSiteConfig on construction.
StaticSiteConfigFrontMatterKeys A subset of the static site config, StaticSiteConfigFrontMatterKeys 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 StaticSiteItemFrontMatter