1
mirror of https://github.com/jakejarvis/hugo-extended.git synced 2025-04-26 04:25:21 -04:00
hugo-extended/README.md

1.8 KiB

hugo-node CI status Hugo v0.63.2 Dependabot

Plug-and-play binary wrapper for Hugo, the awesomest static-site generator.

Install

npm install hugo-node --save-dev
# or...
yarn add hugo-node --dev

hugo-node defaults to the extended version of Hugo on supported platforms, and falls back to vanilla Hugo automatically if unsupported.

Usage

API

const { execFile } = require('child_process');
const hugo = require('hugo-node');

execFile(hugo, ['version'], (error, stdout) => {
  if (error) {
    throw error;
  }

  console.log(stdout);
});

package.json

{
  "scripts": {
    "build": "hugo",
    "start": "hugo serve",
    "create": "hugo new"
  }
}

CLI

$(npm bin)/hugo --help
npm run create -- post/my-new-post.md

or on Windows:

for /f "delims=" %F in ('npm bin') do call "%F\hugo" help
npm run create -- post/my-new-post.md

See the Hugo Documentation for additional functionality.

Examples

License

Forked from fenneclab/hugo-bin under the MIT License, (c) Shun Sato.

Hugo is distributed under the Apache License 2.0.