Verified Commit a614da85 authored by Aral Balkan's avatar Aral Balkan
Browse files

Document the new generic Hugo command() method

parent cca7137b
......@@ -60,6 +60,27 @@ const Hugo = require('node-hugo')
You can also run any Hugo command using the simple passthrough `command()` method:
const Hugo = require('node-hugo')
(async function main () {
const hugo = new Hugo()
try {
// Tell the built-in Hugo binary to create a new site at ./my-new-site/.
await hugo.command('new site my-new-site')
} catch (error) {
console.log('There was an error creating the new site with Hugo'. error)
console.log('Site build successful. Output:', hugo.output)
## Maintenance
### Update Hugo binaries
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment