0.18.1 • Published 4 months ago

mikel-press-cli v0.18.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

mikel-press-cli

npm version license

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 for serve): Sets the port for the local server. Default: 3000.
  • --watch (only for serve): 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.

0.18.1

4 months ago