I want to use hugo as my static site generator but I don’t know how to make it work. I’ve read through the documentation and even the specialised guide for it but I am still really confused as to what I have to do. With jekyll, I could just make a git repository of the entire jekyll blog and I can see the results online instantly. However with hugo I don’t know what I should do. Can someone please explain what I should do to make it work as if I am 5. Thank you a lot for any help.
I have my content in the ‘contents’ folder and I am using a theme I cloned to ‘themes’ (https://github.com/azmelanar/hugo-theme-pixyll). Do I need to put the entire folder under my .github.io directory or just my public folder? I want an efficient workflow that I can use. With jekyll, I simply wrote my markdown files then I just did :
Yes, you can have a nice and easy workflow as the one you described. In the tutorial that Spencer Lyon wrote, you can see a workflow that may suits you.
TL;DR:
You’re going to need two branches, one, the ‘master’ holding all content files and themes. One, called gh-pages as a sub-tree holding only the content of the public dir.
I personally don’t recommend gh-pages to host a website, there are better options like netlify.com (free and paid) and Firebase Hosting. Firebase will get you SSL and CDN for free! And you can use your own domain. And are easy to setup as well.
Yeah, I tried going through his tutorial and I really can’t get it to work. I am sadly not very familiar with git and branching, only know basic commands and the commands he writes out in the guide do not work for me :
But like I said, there are better and easier options instead of gh-pages. I’ve tried firebase and had it running in a blink (I already had nodejs installed).
I am on the same boat, I tried different tutorials for deploying to github with no results. There are many different tutorials out there and none of them worked for me. I gave up at last and waiting for someone to make a tutorial for non techy bloggers like me.
I personally don’t recommend gh-pages to host a website, there are better options like netlify.com (free and paid) and Firebase Hosting5. Firebase will get you SSL and CDN for free! And you can use your own domain. And are easy to setup as well.
I have used the netlify tutorial and it was dead simple to get running. It DOES work in an add > commit > push workflow.
I have just went through the entirety of the tutorial and it is quite nice and clear. However while it does work locally for me and all my posts and everything show, it doesn’t seem to build it properly and doesn’t allow me to see the result live. I have literally done everything by the instructions.
I added the ‘theme = “angels-ladder”’ to my config.toml and everything in there as you have. In my Netlify I have these settings as I wanted to run it on a personal domain I have :
Okay, but I can’t see the theme files on your repository yet. They need to be there, otherwise hugo will create empty html files. Your domain seems fine, a ping to it returns 198.61.251.14
ps: Your build command can be just “hugo” (remove the theme subcommand) as you already have the theme name set in the config file.
For some reason github doesn’t show the contents of the folder, it just shows the folder with the theme. But the theme is under git and on github I believe, perhaps I am wrong. I just did the usual ‘git add .’ git commit . -m ‘init’ git push origin master’.
Actually you are just referencing a cloned repository but Netlify can’t see the files as they are actually not there. Maybe someone more knowledgeable on the git arts can help us in this matter.
But for get things running, delete the * .git folder** from the angels-ladder theme folder and add/commit the files again. After that, the theme files will appear on github.
If you are not sure how to do that, you can add me as a collaborator on the repo, and I do it for you.
Go to settings / collaboration on github and add me there (sjardim)
Just so I understand it, now if I want to add more content, I just write down my markdown files in the ‘post’ directory and git add . git commit . -m ‘new post’ with ‘git push’ and that’s it?
This is really great, also is it okay that I will keep this repository privately? Will Netlify pick it up like that?
All I have left is adding disqus comments and tags and it is complete. Thank you again for your help.
Yes, just write posts and commit them. Netlify will receive a notification automatically and build the site again. Every commit you do will start a new build on Netlify. So be careful with your build limit if are running on the free plan.
Netlify will work on a private repo just fine.
You can remove me from the collaborators now or keep it a little longer if you need.