Add git submodule of theme to existing hugo project

Git cloned a theme and built a hugo project. Now would like to deploy using netlify which does not support git cloned hugo themes.

Is there a quick/easy way to “submodulize” the theme in my existing project?

Or:

  • store my existing /content etc project files in a safe place
  • start a new hugo project using the correct git submodule add procedure
  • cut/paste my project files into the new project

tx

-cm

Hi,

The Hugo docs has instructions for deploying on Netlify: https://gohugo.io/hosting-and-deployment/hosting-on-netlify/#use-hugo-themes-with-netlify

I looked the link over and my concern about using git submodule for themes based on the following:

  1. first sentence of that link: The git clone method for installing themes is not supported by Netlify.

  2. Bunch of blogs suggesting git submodule add was correct method

  3. use of git clone --recurse submodules … command for another hugo project handed to me. Did not understand why this was used

tx

I’m not sure I understand the question. As the docs say, Netlify does not support the git clone method of using themes with Hugo, and the better approach is to use git submodule.

Installed this theme https://github.com/JugglerX/hugo-hero-theme using git clone, built project, then subsequently learned Netlify does not support. So am wondering:

  1. any way I can take existing project and modify it so it considers the theme to have been installed using git submodule or;

  2. save my existing project files, start new project by installing theme using git module, then copy `existing project

finger check! was saying:

  1. save my existing project files, start new project by installing theme using git module , then copy existing project files to new project.

I am thinking it is option 2.

If you have not made a lot of modifications to your project, and if you are not too comfortable using git, your option #2 is probably the easiest way to do it.