I want to use gulp in my Hugo project and I am going to save my static files (CSS, js, images) in separate folder let it be src
. Now when I run hugo
to build my site I want to use src
folder for serving static files but by default, Hugo takes static
folder and create a public
directory with those files. Is this possible in Hugo?
Hey, @kiran-nani - I don’t know the answer to your question, but thought I’d point you to this repo that may be set up the way you’re looking to do. I believe this setup is being used in production by the people who created it: https://github.com/netlify/victor-hugo
@kiran-nani Bud’s recommendation is a good one if you are looking for a single command line to get things started,but I also put together a very basic theme starter that I use for all my internal projects at work that leverage Hugo:
That said, I think maybe what you’re asking for is whether you can tell hugo to use a folder titled “src” rather than “static.” You can do this in your config.toml
file:
staticDir = "src"
Admittedly, I haven’t tested this, but you can find out more information on the configuration page in the docs.
Thank you @budparr I just have a look on the git repo you mentioned.
Thanx for your response. Got some clarity on how to proceed further but only watch the files without any guide is somewhat confusing as I am new to gulp. Is there any blog that you wrote about the process that you follow to build theme-starter-hugo theme? It would be very helpful to me.
@kiran-nani I’m sorry, brother, but I don’t have time to work on a blog right now between work and the side project I’ve taken on where I’m trying to reorganize and rework the Hugo documentation. That said, I’m sure there are support forums for using Gulp and other JS-based asset/built tools. You’ll have a lot more luck asking Gulp-based questions in those venues than you will here.
Also keep in that mind that if you are going to use the (intentionally) minimal theme starter I put together and you want to use “src” rather than “static,” you’ll need to change accordingly for all paths mentioned in gulpfile.js. HTH.
Thank you, bro. I will have look.