-
Notifications
You must be signed in to change notification settings - Fork 0
Ssg
Jérôme Beau edited this page Dec 4, 2022
·
3 revisions
Ssg is Static Site Generation API main class, which is responsible for executing Steps.
Typical usage of Ssg is:
- create a
newinstance with a SsgConfig (which consist basically in a{outDir: string}) -
addSteps to it (mind the order) -
startthe generation with a Context
For instance:
import {SsgConfig, SsgContextImpl, Ssg, ContentStep, CopyStep} from "ssg-api"
const config: SsgConfig = {outDir: "out"}
const context = new SsgContextImpl("fr")
new Ssg(config)
.add(new ContentStep(contentConfigs, outputFunc))
.add(dir1SubdirectoriesStep)
.add(dir2SubdirectoriesStep)
.add(...anArrayOfSteps)
.add(new CopyStep(copiesToDo))
.start(context)