1.7.4 • Published 29 days ago

ssg-api v1.7.4

Weekly downloads
-
License
MIT
Repository
github
Last release
29 days ago

ssg-api CircleCI

TypeScript API to generate output files from input files.

It can be used to generate:

  • a static website from HTML templates (but those templates can include client-side JavaScript and CSS of course).
  • (and/or) other files such as configuration files (for instance converting an .htaccess file to a netlify.toml file)

To 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); // Write your own SSG steps!

const context = new SsgContextImpl("fr");
try {
  const result = await ssg.start(context);
  context.log("Completed", result);
} catch (err) {
  context.error(err, context.inputFile.name, "=>", context.outputFile.name);
}

Steps can do anything. You can implement your owns, but there are predefined ones. Check the documentation for more.

1.7.4

29 days ago

1.7.3

1 month ago

1.7.2

3 months ago

1.7.1

4 months ago

1.7.0

4 months ago

1.6.4

4 months ago

1.6.3

4 months ago

1.6.2

4 months ago

1.6.1

4 months ago

1.6.5

4 months ago

1.6.0

5 months ago

1.5.2

6 months ago

1.5.1

7 months ago

1.5.0

8 months ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.3.2

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago