Skip to content

Commit

Permalink
Include hugo as a npm dependency
Browse files Browse the repository at this point in the history
Don't require hugo to be installed separately; instead list the node
wrapper module hugo-bin as a dependency.
  • Loading branch information
MattSturgeon committed Jul 30, 2017
1 parent 6ee3b2f commit 313be1b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ please read the [code of conduct](CODE_OF_CONDUCT.md).

## Setup

> Install Hugo in your system: https://github.com/spf13/hugo/releases
```sh
$ git clone https://github.com/netlify/victor-hugo
$ cd victor-hugo
Expand Down
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ This project is released under the [MIT license](LICENSE). Please make sure you

## Usage

Be sure that you have the latest node, npm and [Hugo](https://gohugo.io/) installed. If you need to install hugo on OSX, run:

```bash
brew install hugo
```

If you don't use OSX or don't use homebrew, follow the instructions for installation here instead:

http://gohugo.io/overview/installing/
Be sure that you have the latest node and npm installed.

Next, clone this repository and run:

Expand Down
6 changes: 3 additions & 3 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import gulp from "gulp";
import cp from "child_process";
import { spawn } from "child_process";
import hugoBin from "hugo-bin"
import gutil from "gulp-util";
import postcss from "gulp-postcss";
import cssImport from "postcss-import";
Expand All @@ -9,7 +10,6 @@ import webpack from "webpack";
import webpackConfig from "./webpack.conf";

const browserSync = BrowserSync.create();
const hugoBin = "hugo";
const defaultArgs = ["-d", "../dist", "-s", "site", "-v"];

gulp.task("hugo", (cb) => buildSite(cb));
Expand Down Expand Up @@ -53,7 +53,7 @@ gulp.task("server", ["hugo", "css", "js"], () => {
function buildSite(cb, options) {
const args = options ? defaultArgs.concat(options) : defaultArgs;

return cp.spawn(hugoBin, args, {stdio: "inherit"}).on("close", (code) => {
return spawn(hugoBin, args, {stdio: "inherit"}).on("close", (code) => {
if (code === 0) {
browserSync.reload();
cb();
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"gulp-babel": "^6.1.2",
"gulp-postcss": "^6.1.1",
"gulp-util": "^3.0.7",
"hugo-bin": "^0.11.0",
"imports-loader": "^0.7.1",
"postcss-cssnext": "^2.7.0",
"postcss-import": "^10.0.0",
Expand Down

0 comments on commit 313be1b

Please sign in to comment.