Flattening Hugo theme module? #32
Replies: 4 comments 10 replies
-
Sorry, I don't follow what does the flatten mean.
Hugo collects only the modules you imported, so you don't need to take care of this, or remove the unused modules from the config.
Does it required to collect the modules every first time after reboot? If so, please configure the cachedir if you're using Hugo that version is less than
|
Beta Was this translation helpful? Give feedback.
-
|
About the GitHub Actions, there is an real example of HB documemtation site (around 2k pages, 160 processed images and some time consuming operations like GitHub APIs), which takes about |
Beta Was this translation helpful? Give feedback.
-
|
Btw, there is a command for vendoring the modules: hugo mod vendor, but it's currently not availble, see gohugoio/hugo#10123. |
Beta Was this translation helpful? Give feedback.
-
|
Sorry for the vague explanation of my 'plan'. I will describe my 'plan' as detailed as possible. Current Problem
My PlanI think nested and complicated Hugo module structure causes long build time. I remember that few years ago when I downloaded whole theme file into If I make Hugo only look single directory or repository, it may reduce build time. Currently, my site depends on multiple modules: Hugo have to dig into this dependency tree to gather required files to build site. But if I minimize dependency tree to be like this, this may help build time to be shorter.
This structure may be similar to 'monorepo' design, or like you did in hbstack/blog repository. But instead, it doesn't have Sorry if this idea is still vague to you. If you tell me where you don't understand well, I will explain that part more detailed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is niche use case, but here is my story.
When I boot into my OS and run
hugo serverfirst time, it takes 45 seconds to collect modules. It also requires additional ~10 seconds to build site and serve it from RAM. But in next run, it doesn't take too much time. To me, this looks like wasting my time. I have to wait almost 1 minutes to see my site locally.I'm concerned that this might cause CI build time to be long too.
Taking too much time in local environment is just an (very) annoying problem, but taking too much time in CI build is a problem because GitHub Free plan limits total Action running time to 2,000 minutes per a month.
I haven't tried to run site build in GitHub yet though.
So, I'm thinking about flattening Hugo theme files.
If I use GitHub Action to download all of the HB Theme's dependencies and files, combine them in one repository and let Hugo use that repository only, it might help site building time, because Hugo don't need to dig through dependency tree and get files directly from the repository.
Of course, since HB Theme evloves as time passes, the dependencies should be updated too. With GitHub Action, I think it can be configured to fetch latest dependencies daily or manual basis.
But I don't know well about how Hugo modules and Go modules works.
module.importsinhugo.yaml?Beta Was this translation helpful? Give feedback.
All reactions