Coder Social home page Coder Social logo

Comments (5)

talves avatar talves commented on June 23, 2024

@DotTech I personally remove the hugo bin folder and this is one of the reasons why I would do so. You will have to run your own local version of Hugo to have the command work for development.

See my answer on StackOverflow.

from one-click-hugo-cms.

DotTech avatar DotTech commented on June 23, 2024

Thank you @talves!
Removing the bin folder solves the build issue.
I still don't understand why it does work with the cloned repository...
But at least I have a way of getting it to work now :)

from one-click-hugo-cms.

talves avatar talves commented on June 23, 2024

It does sound a little odd to me also.

from one-click-hugo-cms.

DotTech avatar DotTech commented on June 23, 2024

I have found a solution that allows Hugo to stay in the repo without interfering with the Netlify build:

  • I added the environment variable HUGO_VERSION = "0.46" to the netlify.toml file
  • I've updated gulpfile.babel.js like this:
// Replace this line:
// const hugoBin = `./bin/hugo.${process.platform === "win32" ? "exe" : process.platform}`;

// With this:
var hugoBin = `./bin/hugo.${process.platform === "win32" ? "exe" : process.platform}`;
if (process.env.HUGO_VERSION) {
  hugoBin = 'hugo'
}

That way the bin folder Hugo will be used locally and ignored during a Netlify build.
I'll try to create a pull request for this.

from one-click-hugo-cms.

talves avatar talves commented on June 23, 2024

This is a good way to handle it. Keeps a unique version of Hugo in each project for local and targets the correct version of Hugo for Netlify. Would allow for multiple versions to run on your local machine, when needed.

Gives me an idea to run diff versions local out of a global scope (install dir).
hugo/root/location/0.45/hugo.exe

if (process.env.HUGO_VERSION) {
  if (process.env.NODE_ENV === 'development') {
    hugoBin = path.resolve(HugoRootLocation, process.env.HUGO_VERSION, 'hugo')
  } else {
    hugoBin = 'hugo'
  }
}

from one-click-hugo-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.