Socket
Socket
Sign inDemoInstall

zola-bin

Package Overview
Dependencies
4
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    zola-bin

Zola, A Static Site Generator, as a NPM Package


Version published
Weekly downloads
16
decreased by-33.33%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.3.7 (2023-04-02)

  • Update zola version to v0.17.2

Readme

Source

zola-bin

npm npm GitHub release (latest SemVer)

What is Zola ?

Zola is a static site generator (SSG), similar to Hugo, Pelican, and Jekyll. It is written in Rust and uses the Tera template engine, which is similar to Jinja2, Django templates, Liquid, and Twig. Content is written in CommonMark, a strongly defined, highly compatible specification of Markdown.

Why Zola as a NPM package ??

Zola provides pre-built binaries for MacOS, Linux and Windows on its GitHub release page.

This package can be used for calling the pre-built Zola binary through Node, making it a part of node's vast NPM ecosystem. This package is a cross-platform, easy to install and integrate with other NPM packages. Also, This package gets the binaries directly from Zola Releases Page.

Usage

Add it as a dependency into your project or a new one, using....

npm i zola-bin

or

npm i -g zola-bin

From CLI

Format: zola-bin [args]

args are same as official zola CLI. Additionally, In your project's package.json file, you call it inside a script after adding it as a devDependency.

"scripts": {
    "dev": "zola-bin serve --port 7000 --open",
    "build": "zola-bin build"
}

JavaScript API

Note: Only supports ESM

import zola, { execZola, getZolaPath } from "zola-bin";

execZola([....args]); // same as calling zola-bin [args] from command line

Following methods are just a wrapper around execZola.

Check out for usage - https://www.getzola.org/documentation/getting-started/cli-usage

interface buildOps {
	base_url?: string;
	output_dir?: string;
	config_file?: string;
}
interface serveOps extends buildOps {
	open?: boolean;
	port?: number;
	interface?: string;
}

declare const zola: {
	build(options?: buildOps): void;

	serve(options?: serveOps): void;

	check(): void;

	help(cmdHelp?: "build" | "serve" | "check" | "init"): void;

	init(name?: string): void;
};

export default zola;
getZolaPath(): string; // returns path to zola binary

Environment Variables

Supports adding a custom zola binary path. Create a .env file in your project root directory and add the following line:

ZOLA_BIN_PATH="./somePathToZolaFile"

or

ZOLA_BIN_PATH="./somePathToZolaFile" zola-bin [args]

Keywords

FAQs

Last updated on 01 Apr 2023

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc