mikel-press-cli v0.18.1
mikel-press-cli
The mikel-press CLI is a command-line tool for generating and serving static sites using mikel-press. It reads configuration settings from a press.config.js
file and provides an easy way to build and preview your static website.
Installation
To install the CLI into your project, run:
$ yarn add mikel-press
Usage
Once installed, you can use the mikel-press
command from your terminal. The CLI provides two main commands:
mikel-press build
Generates the static site based on the configuration file. This command reads the press.config.js
file (or another specified configuration file) and generates the static site.
mikel-press serve
Builds the static site and starts a local web server to preview the generated content. By default, the server runs on port 3000
, but you can customize it using the --port
option.
Options
--config <path>
: Specifies the path to the configuration file. Default:press.config.js
.--port <number>
(only forserve
): Sets the port for the local server. Default:3000
.--watch
(only forserve
): Watches for changes in the source files and automatically rebuilds the site when modifications occur.
Example Configuration File (press.config.js
)
Below is an example configuration file for mikel-press:
import press from "mikel-press";
export default {
source: "./content",
destination: "./public",
layout: "./layouts/main.html",
title: "My Static Site",
plugins: [
press.SourcePlugin(),
press.ContentPlugin(),
],
};
License
This project is licensed under the MIT License.
4 months ago