Socket
Socket
Sign inDemoInstall

ssg-api

Package Overview
Dependencies
556
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ssg-api

Static Site Generation TypeScript API


Version published
Weekly downloads
22
decreased by-79.44%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

ssg-api

TypeScript API to generate a static website.

ssg-api has been developed to generate the RR0 website, so you'll find examples of Steps and Replacers in the website repository.

Concepts

Step

The Ssg execute a number of Steps, sequentially. A Step can do anything, but here are some pre-defined steps:

For instance:

 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)
        .then(result => console.log("Completed", result))
        .catch(err => console.error(err, context.inputFile.name, "=>", context.outputFile.name))
Extensibility

You can create:

  • your own steps by implementing the SsgStep interface.
  • your own context by implementing the SsgContext interface, typically to provide additional info to the custom .

Replacements

In the case of a ContentStep, predefined replacements are also available:

Keywords

FAQs

Last updated on 08 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc