SSGO LogoDOCS

About templates

Templates are the skeletons of your pages, and are used by Creators to build pages. A template can be used as much time as needed to build pages.

For example, this documentation site is built with ssgo and uses a single template for all the documentations pages (pages under /docs).

Templates are used through the first argument of the buildPage function, that is given to every creator default exported function as first parameter.

// my-creator.ts

export default (buildPage) => {
  buildPage(
    "my-template.html", // <-- the path of the template to use (relative to the root of the templates/ directory)
    contextData,
    { filename: "my-page.html" }
  )
}

ssgo templates allow you to do the following things:

Some helpers are also automatically provided to page builds contexts under the ssgo key:


Something about this page is wrong? Edit it on GitHub.