Getting a fatal error when I try deploying to Cloudflare. I created the Hugo site locally on VSCode using Hugo Theme ‘Blist’, and when I try to deploy from GitHub Repo the error says:
fatal: No url found for submodule path ‘themes/blist’ in .gitmodules
But I have created the .gitmodules file and included the path to the URL. I have looked everywhere and I don’t know what is wrong.
I am using hugo version v0.105.0+extended darwin/amd64
I am using Node.js version 18.12.1
Under the themes directory, what directory is the theme in?
And how did you add the theme to your project? Typically the process would be:
hugo new site foo
git submodule add https://github.com/apvarun/blist-hugo-theme.git themes/blist
echo "theme = 'blist'" >> config.toml
cp themes/blist/package* .
hmm. I did not do that. followed a tutorial on youtube. i did:
hugo new site foo f- yml
git clone https://https://github.com/apvarun/blist-hugo-theme.
theme also called for the steps I added to the screen shot. I dragged the package-lock.json file out and dropped it in the root but i forgt to move the package.json I just realized when talking to you. I am going to check now to see if this is the problem
Cloning the theme, then creating a
.gitmodules file, is not the same as using
git submodule add.
Do what I did. It’s tested.
Got it. Thank you. so, just to be clear, my best course right now would be to delete the project and start from the beginning? And for future reference the best practice when creating a hugo site is to use the git submodule command?
If you are not too far along, yes. Just backup anything significant you have created before you delete the directory.
Install a theme as a Git submodule or as a Hugo Module.
I am. But I learned a lot this time around so i think I could redo the whole project much faster and gain some good experience practicing it one more time.
Thanks for your help. I have been trying to figure this out for two days now. Should have read the Hugo docs instead of deferring to YouTube. Lesson learned. Thanks again.
If I may ask one more question, I am following your instructions above and its working out so far, but I am not having any luck with this command:
[cp themes/foo/package* . ]
I am using a different theme but I thought it should probably be the same process. I keep getting the message no matches found or no such file or directory. Is this command necessary?
Not all themes need or use npm packages. Which theme?
Well, the theme uses npm.
So if you have installed the theme correctly, you should see package* files in the theme’s root directory.
I think I got it. I had to make it hugo-scroll. I didn’t config it in yml this time either so maybe I’ll have better luck leaving it in TOML.
Thank you again for all of your help!
Never mind. Now I am getting an error message with the npm ci command. I am having no luck here. This seems like maybe a different issue than the one I opened so I should move it to a new issue
Doesn’t look like an error, just a notice. What happens when you run
I have to start over because I entered the echo "theme = ‘scroll’ instead of ‘hugo-scroll’ but I think it will work this time. That was my carelessness.
If that’s your only mistake, just edit config.toml.
Got it! Server is working on localhost:1313. Thank you so much for your help!
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.