via NPM
Plug-and-play binary wrapper for Hugo Extended, the awesomest static-site generator.
Install
npm install hugo-extended --save-dev
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.