Solved Any good getting started with Hugo resources
-
@JaredBusch said in Any good getting started with Hugo resources:
@stacksofplates said in Any good getting started with Hugo resources:
cp -R themes/theme/examplesite/* .
Why do this? Why can't I just create my own things? Why bring everything from the example up?
I don't mind this, just trying to understand the logic.
I do it so I have something to look at and modify to my own needs, such as the .yml files that have the layouts of pages and/or sections of pages, and other "templates" to work off of. It shows you a working example of content to work from, which helps, me at least, in the design process.
But if you know ahead of time exactly how the theme needs things, there's absolutely no need to do it if you want to create it all from scratch. Maybe that's easier for you. But for me, it's quicker and easier to work from templates and see the big picture as I make changes and add content.
For example, if you don't copy any of that over, and you run the site, it will look messed up as none of the default template images and such will be showing. It's likely none of the menu links will work until you create the pages, etc. It's subjective, do it how you want.
-
@JaredBusch said in Any good getting started with Hugo resources:
@stacksofplates said in Any good getting started with Hugo resources:
How they want you to do it works like this:
mkdir -p mysite/themes
git clone theme into themes
cp -R themes/theme/examplesite/* .
#3 is obv assuming you're in the site directory. You're done. Now just edit your config.
You can also do
hugo new site
and it gives you a directory structure but if you're using the themes example folder it's not really needed.From what I was reading, you don't want to actually
git clone
the theme.Instead you should always
git submodule
it.hugo new site jaredbusch.com cd jaredbusch.com git submodule add -f https://github.com/geschke/hugo-tikva themes/hugo-tikva
Right. That was just a simple get going thing. A submodule is definitely the way to go.
-
@JaredBusch said in Any good getting started with Hugo resources:
I had never used submodule before. So I had to look it up.
Submodule is interesting because it adds everything into your repo also.
For another project, I had a
custom
folder that was different per client.
So in the main repo I hadcustom/.gitkeep
to have the empty folder there.
Then I addedcustom/
to the.gitignore
.
Then I had a separate project that I cloned into the custom folder.There's two different methods. Submodule and subtree. Subtree you have to install separately. Subtree is a separate project tree inside of your project. Submodule is a specific checkout hash of a repo. Subtle difference but they can overlap some.
-
@JaredBusch said in Any good getting started with Hugo resources:
@stacksofplates said in Any good getting started with Hugo resources:
cp -R themes/theme/examplesite/* .
Why do this? Why can't I just create my own things? Why bring everything from the example up?
I don't mind this, just trying to understand the logic.
Each theme has it's own specific settings. The example gives you all of those settings without having to read through all of their theme and find the settings for yourself. You can delete the files in content/ that you don't need. It's just a way to show you how to use the theme and give you a default
config.toml
.