Verified Commit 7555080e authored by Aral Balkan's avatar Aral Balkan
Browse files

Add option to disable build drafts for Hugo server

parent e642149d
......@@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [1.4.1] - 2020-06-28
### Added
- Option to disable build drafts for Hugo server; new fourth parameter in serve() method.
## [1.4.0] - 2020-05-05
......
......@@ -96,18 +96,22 @@ class Hugo {
// - a reference to the Hugo server process
// - the Hugo output so far
//
serve (sourcePath = '.', destinationPath = 'public/', baseURL = 'http://localhost:1313') {
serve (sourcePath = '.', destinationPath = 'public/', baseURL = 'http://localhost:1313', buildDrafts = true) {
const args = [
'server',
`--source=${sourcePath}`,
`--destination=${destinationPath}`,
`--baseURL=${baseURL}`,
'--buildDrafts',
'--renderToDisk',
'--disableLiveReload',
'--appendPort=false',
'--disableFastRender'
]
if (buildDrafts) {
args.push('--buildDrafts')
}
return this.serverWithArgs(args)
}
......
{
"name": "@small-tech/node-hugo",
"version": "1.4.0",
"version": "1.4.1",
"description": "A basic cross-platform interface to the Hugo binary from Node.js.",
"main": "index.js",
"scripts": {
......
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