Hugo-bin extended package

Hello,

I’m trying to extend netlify’s one-click-hugo-cms to work with sass files. I’ve seen that hugo is not extended version so I’d like to make it so. Hugo is installed as hugo-bin module of npm.

Is there a way to change package.json in order to get hugo-bin extended version installed?

This is my package.json file.

{
“name”: “victor-hugo”,
“version”: “1.0.0”,
“description”: “Victor Hugo is a Hugo boilerplate for creating truly epic websites!”,
“repository”: “netlify/victor-hugo”,
“main”: “index.js”,
“scripts”: {
“lint”: “eslint src”,
“start”: “run-p start:",
“start:hugo”: “hugo -d …/dist -s site -vw”,
“start:webpack”: “webpack-dev-server --config webpack.dev.js --hot”,
“preview”: "run-p preview:
”,
“preview:hugo”: “npm run start:hugo – -D -F”,
“preview:webpack”: “npm run start:webpack”,
“prebuild”: “rimraf dist”,
“build”: “npm run build:webpack && npm run build:hugo”,
“build:preview”: “npm run build:webpack && npm run build:hugo:preview”,
“build:hugo”: “hugo -d …/dist -s site -v”,
“build:hugo:preview”: “npm run build:hugo – -D -F”,
“build:webpack”: “cross-env NODE_ENV=production webpack --config webpack.prod.js”
},
“author”: “”,
“license”: “MIT”,
“devDependencies”: {
@babel/core”: “^7.5.5”,
@babel/plugin-proposal-object-rest-spread”: “^7.5.5”,
@babel/plugin-syntax-object-rest-spread”: “^7.0.0”,
@babel/preset-env”: “^7.5.5”,
@babel/preset-react”: “^7.0.0”,
@babel/register”: “^7.5.5”,
“assets-webpack-plugin”: “^3.9.7”,
“babel-eslint”: “^10.0.1”,
“babel-loader”: “^8.0.4”,
“clean-webpack-plugin”: “^3.0.0”,
“copy-webpack-plugin”: “^5.0.0”,
“cross-env”: “^5.2.0”,
“css-loader”: “^3.1.0”,
“date-fns”: “^1.30.1”,
“eslint”: “^6.1.0”,
“eslint-plugin-import”: “^2.18.2”,
“exports-loader”: “^0.7.0”,
“fancy-log”: “^1.3.2”,
“file-loader”: “^4.1.0”,
“html-webpack-plugin”: “^3.2.0”,
“hugo-bin”: “^0.44.3”,
“imports-loader”: “^0.8.0”,
“mini-css-extract-plugin”: “^0.8.0”,
“netlify-cms-app”: “^2.9.6”,
“node-sass”: “^4.10.0”,
“npm-run-all”: “^4.1.5”,
“optimize-css-assets-webpack-plugin”: “^5.0.1”,
“plugin-error”: “^1.0.1”,
“postcss-import”: “^12.0.1”,
“postcss-loader”: “^3.0.0”,
“postcss-preset-env”: “^6.3.0”,
“react”: “^16.8.6”,
“react-dom”: “^16.8.6”,
“rimraf”: “^2.6.2”,
“sass-loader”: “^7.1.0”,
“style-loader”: “^1.0.0”,
“terser-webpack-plugin”: “^1.3.0”,
“to-string-loader”: “^1.1.5”,
“url-loader”: “^2.1.0”,
“webpack”: “^4.37.0”,
“webpack-cli”: “^3.1.2”,
“webpack-dev-server”: “^3.1.10”,
“webpack-merge”: “^4.1.4”
}
}

I read Netlify and Hugo extended. Maybe the one click package of Netlify’s Hugo is not that far yet, but you can set the “Build Image” of your Netlify account to a current version that has Hugo extended installed.

Go to app.netlify.com, then Deploys, then Deploy Settings and scroll down to “Build image selection” and select “Ubuntu Xenial 16.04 (default)”. This is a recent feature, so if you created your site more than half a year ago it’s probably set to 14.04.

Other than that: there is no way to tell Netlify what Hugo to install. In my experience it’s always the latest.

Is there a reason you’ve chosen to go with the ‘one click install’? Unless you’re familiar with webpack, gulp, etc, I reckon it’s harder than simply using Hugo by itself. (Before Hugo had SASS processing built in, it made sense, but I’m not sure now.)

If you’re used to using those other tools, then you probably should use them to process your SASS rather than Hugo (because that’s how their system is built).

2 Likes

And if you really want to use this setup, change “hugo-bin”: “^0.44.3”, to “hugo-bin”: “^0.57.2”, (I assume this will work.)

Hello, I’ve created my site fairly recently. Like 10 days ago. I’ve used Netlify CMS and this is default stuff they offer.
I can try to use 0.57.2 but I think it’s not the version but I need to have extended hugo version installed. As for why I chose it, I suppose I went for the default. The feature I need is Netlify CMS. If I can go only with hugo and later add Netlify CMS, this would be great but I don’t know if this is viable path to take.

It’s very easy to add Netlify CMS to a hugo site.

Though if you really want to stick with the ‘one click install’ wrapping, it seems you can use the extended version by putting this in your package.json

"hugo-bin": {
    "buildTags": "extended"
  }

(And it seems the latest version available this way is 0.45.2)