hugo-extended 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
API
const { execFile } = require('child_process');
const hugo = require('hugo-extended');
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.