How to get started on Hugo netlify?

Any suggestions on Hugo tutorials tailored to netlify?

Or even any books to read? :wink:

I have zero background in the topic.

Thank you!

hey @ng0177!

These are some tutorials other people have mentioned here in the forums:

Quickstart Hugo
Hugo deploy on Github+Netlify
How I pushed my repository to Github
Getting Started with Hugo and deploying to Netlify

I haven’t worked through these myself, so I can’t guarantee they are 100% up to date, but they are likely a good starting point!

2 Likes

Thanks :slight_smile: I studied these plus dicussed with @amalik in Where are you from? but still cannot figure out how to get content, theme etc. from the site firstly created by default https://sim-val-tech.netlify.com/ into to my local hugo install under Linux to modify it. Any advice?

The ressources kindly posted by @perry could be completed by these blog posts :

2 Likes

I studied these guides ( A Step-by-Step Guide: Victor-Hugo on Netlify | Netlify is my preference) plus importantly learnt some GitHub basic methods and commands but still face three problems:

git clone https://github.com/ng0177/victor-hugo.git
cd /path/to/victor-hugo/site
hugo server -D

  • problem two: when making changes or adding content, are the following command sufficient to publish them? Should it be better to publish to a branch and if so, how?

git add .
git commit -m “message”
git remote add origin
git remote -v
git push origin master

  • problem three: there are different netlify.toml files in all the tutorial. I had hoped to find the right one in the github repository created by netlify but there is none - is it really needed? How to include netlify.toml ?

I prefer the GitHub CLI as explained here. Thanks!

That’s a lot of studying! Nice work :muscle: Responding here in order of the problems you mentioned:

  1. After git clone, you’ll need to npm install if you want to get things running locally. Your preferred guide mentions that step here: https://www.netlify.com/blog/2016/09/21/a-step-by-step-guide-victor-hugo-on-netlify/#building-your-site
  2. Those commands are in fact sufficient to publish changes. The command git remote add origin also requires a repo URL that corresponds to the name “origin”- so the full command would be git remote add origin YOUR_URL; GitHub has docs on that here: https://help.github.com/en/github/using-git/adding-a-remote
  3. It’s very possible to build a site without a netlify.toml file! Just configure the same options in the Netlify UI. However, since you are just getting started with many of these tools, I would closely follow the instructions in whatever tutorial you are following until you get a site working. Then, once it’s working, you can change one thing at a time to see how different pieces work (for example, tweak the netlify.toml, or remove it altogether)

Hope this is helpful!

1 Like

Appreciate the help :top:

  1. It boils down to the options of using npm start vs hugo server according to hugo-quickstart and hugo-netlify tutorials respectively. I prefer hugo server under ./site/ but the css are missing.

Is there a way to get hugo server to work on my downlod of the automatically created github site - telling it where to find the css?

  1. I do master github by now :slightly_smiling_face:

  2. Is it safe to replace the supplied netlify.toml

[build]
command = “npm run build”
publish = “dist”

by the one suggested on hugo quickstart

[build]
publish = “public”
command = “hugo --gc --minify”

once public is replaced by dist and version number is adapted? Thanks!

P.S. The correct link for hugo quickstart is this.

1 Like
  1. If you’re going with the Hugo quickstart tutorial, which it sounds like you prefer, I believe you would run hugo server from the root directory as opposed to ./site/- if your root directory is called “site”, I would try to cd into that directory and enter just hugo server in your terminal
  2. Awesome :slight_smile:
  3. If you’re working from the Hugo quickstart tutorial that you linked (https://gohugo.io/getting-started/quick-start/), it looks like the “publish” directory is “public”—not “dist”. So replacing the netlify.toml as you described will not work. I would stick with one tutorial and the netlify.toml that it recommends.

Thanks for that :slight_smile: I finally decided to go with https://gohugo.io/hosting-and-deployment/hosting-on-netlify/

The default created by Netlify using npm and no theme under themes, I did not use, because it was not clear to me.

Appreciate all the help!

1 Like