Skip to content

Context

Jérôme Beau edited this page Nov 11, 2022 · 5 revisions

A SsgContext is provided to Ssg methods (SsgStep.execute(content) and ReplaceCommand.execute(context)) to carry information about :

  • the current locale(s)
  • the current inputFile that has been read
  • the current outputFile that is about to be written
  • current values of variables values (through getVar()) that may have been set by current or previous replacements (through setVar()).

It also provides utility logging methods (log()/warn()/error()/debug()) and a clone() method.

You can create your own context by implementing the SsgContext interface (typically to provide custom info to custom steps).

Clone this wiki locally