@perseveranza-pets/dante

Opinionated static site generator.

View on GitHub

Introduction

%s %s

Opinionated static site generator.

http://sw.cowtech.it/dante

Installation

npx --package=@perseveranza-pets/dante -- create-dante-site my-site 
cd my-site 
npm install 
dante dev

Usage

Creating pages and files

Simply create all file needed in the build function in src/build/index.ts. You can use any framework you want, the predefined one when using create-dante-site is React.

We strongly recommend to use the createFile function exported from dante to create file as it will take care of replacing $hash in the file name with the actual file hash.

The function must return an object containing the following properties:

All properties can be (async) function that will be called for each page at runtime.

Customizing the server

If you want to customize the local server, you can create a setupServer function in src/build/server.ts. The function will receive a fastify server instance and build context.

The function can optionally return an object containing the following properties:

Exporting

Once you have done editing, you should execute dante build. The website will be exported in the dist folder.

Adding commands to Dante

You can create a file src/build/cli.ts that should export a setupCLI function. The function will received a commander program and a pino logger in order to modify the Dante CLI.

Customize create-dante-site

You can create a file src/build/create.ts that should export a createSetupCLI function. The function will received a commander program and a pino logger in order to modify the Dante CLI.

Environments variables

ESM Only

This package only supports to be directly imported in a ESM context.

For informations on how to use it in a CommonJS context, please check this page.

Contributing to dante

Copyright

Copyright (C) 2022 and above Shogun (shogun@cowtech.it).

Licensed under the ISC license, which can be found at https://choosealicense.com/licenses/isc.