Flores
Minimalist static site generator.
Installation
$ npm install flores
Usage
const flores = require("flores");
(async () => {
await flores.build();
})();
API
flores.build
Generate the website.
flores.build([options])
Parameters
flores.serve
Generate the website and start the development server.
flores.serve([options])
Parameters
flores.watch
Start the development server and watch for the file changes. It will automatically refresh the browser on file changes.
flores.watch([options])
Parameters
Configuration Options
Configuration options is an optional Object
that you can pass to build
, serve
, or watch
methods.
env
(String
): The environment name, default to process.env.NODE_ENV
. If the NODE_ENV
environment variable is not set, production
will be set. Note that for serve
and watch
methods, the env
value will always be set to development
.url
(String
): The website URL, default to http://localhost:4000
.basePath
(String
): The base path of your website project directory, default to process.cwd()
.sourceDir
(String
): The directory for the website source relative to the basePath
, default to src
.outputDir
(String
): The directory where the generated website will be stored relative to the basePath
, default to public
,templatesDir
(String
): The templates directory relative to the sourceDir
, default to templates
.assetsDir
(String
): The CSS assets directory relative to the sourceDir
, default to assets
.defaultTemplate
(String
): The default template name for the markdown post, default to post.njk
. You can override the template for individual post by providing the template
field on the post's front matter.defaultCollectionTemplate
(String
): The default template name for the markdown post collection page, default to collection.njk
. You can override the template for individual post collection page by providing the template
field on the page's front matter.copyFiles
(Array
): List of files or file patterns to copy, default to:
["images/**", "robot.txt", "**/*.html"]`
{
stage: 3,
preserve: false
}
License
MIT © Risan Bagja Pradana