1
mirror of https://github.com/jakejarvis/hugo-extended.git synced 2025-04-26 15:48:29 -04:00

Hugo via NPM CI status npm Hugo v0.63.2 Dependabot

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

Install

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

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

Usage

See the Hugo Documentation for additional functionality.

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

API

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

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

  console.log(stdout);
});

Examples

License

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

Hugo is distributed under the Apache License 2.0.

Description
Plug-and-play Node.js wrapper for Hugo Extended, the awesomest static-site generator. ✏️
https://www.npmjs.com/package/hugo-extended Readme 3.4 MiB
Languages
JavaScript 100%