-
Notifications
You must be signed in to change notification settings - Fork 0
Setup
Jérôme Beau edited this page Nov 11, 2022
·
4 revisions
Install ssg-api as a project dependency:
npm install --save ssg-api
Then import the required types to implement your own SSG code:
import {Ssg, SsgContextImpl, SsgConfig} from "ssg-api"
const config: SsgConfig = {outDir: "out"}
const ssg = new Ssg(config)
.add(firstStep)
.add(nextStep) // See "Concepts" for a description of steps
const context = new SsgContextImpl("fr", {})
try {
const result = await ssg.start(context)
console.log("Completed", result)
} catch (e) {
console.error(err, context.inputFile.name, "=>", context.outputFile.name)
}