From 313be1bce144ab128dbea11e3d6fdb5e8de9ea74 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sun, 30 Jul 2017 03:03:01 +0100 Subject: [PATCH 1/3] Include hugo as a npm dependency Don't require hugo to be installed separately; instead list the node wrapper module hugo-bin as a dependency. --- CONTRIBUTING.md | 2 -- README.md | 10 +--------- gulpfile.babel.js | 6 +++--- package.json | 1 + 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a801680..e5575bf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/README.md b/README.md index d0c55ca..caf7b68 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 8aafe62..ccf48fc 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -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"; @@ -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)); @@ -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(); diff --git a/package.json b/package.json index c40797a..b0dd480 100644 --- a/package.json +++ b/package.json @@ -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", From 6a37cacd55756690fe5ff4ec7d0e92b49eda81b5 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sun, 30 Jul 2017 04:32:07 +0100 Subject: [PATCH 2/3] Revert "Pin Hugo version on Netlify to the most recent one." Since 313be1b we install hugo via npm, so there is no need for netlify to know the hugo version anymore. This reverts commit 571859a51bf44738e2519bd069e0964ec9101059. --- README.md | 5 ----- netlify.toml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/README.md b/README.md index caf7b68..6c26b83 100644 --- a/README.md +++ b/README.md @@ -78,11 +78,6 @@ You can also click this button: [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/eliwilliamson/victor-hugo) -### Picking the right version of Hugo -Victor-Hugo doesn't make any assumption on which version of Hugo you use, this boilerplate works with any version above v0.13. However, the version -installed on your computer might not be the same version that Netlify uses to build your site. To ensure that those two versions match, open the `netlify.toml` -file and change the `HUGO_VERSION` variable to match the version you use in your computer. If you don't know which version you're using in your computer, you -can open a terminal and run `hugo version`, that will display the version in your computer. ## Enjoy!! diff --git a/netlify.toml b/netlify.toml index 8b07598..dd1ef8e 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,10 +2,5 @@ command = "npm run build" publish = "dist" -# Change the version of Hugo you want to use on Netlify -# by changing this environment variable. -[build.environment] - HUGO_VERSION = "v0.25.1" - [context.deploy-preview] command = "npm run build-preview" From 10ee33cf5da14cd63e4f683a8b2b766610f697ec Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sun, 6 Aug 2017 02:52:17 +0100 Subject: [PATCH 3/3] Update hugo-bin to 0.12 (hugo 0.25.1) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0dd480..5f8ead7 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "gulp-babel": "^6.1.2", "gulp-postcss": "^6.1.1", "gulp-util": "^3.0.7", - "hugo-bin": "^0.11.0", + "hugo-bin": "^0.12.0", "imports-loader": "^0.7.1", "postcss-cssnext": "^2.7.0", "postcss-import": "^10.0.0",