DEV Community

Creating a Hugo site on GitHub Pages

Dillon on September 11, 2018

Quick Backstory So I've just begun my journey as a web developer and I was stumbling along trying to create a website when I came across...
Collapse
 
primercuervo profile image
Nicolas Cuervo

I've been through the same journey since a couple of weeks ago and I gotta say that you have put together some nice points in here. My two cents:

If you are here you should have the following installed:

Homebrew
Go

This is going too into the specifics, mostly because they are not necessarily a requirement. These are only valid on a fresh macOS machine, and are not the case, let's say, if you are using Ubuntu for example. I'd just point out to the hugo installation page for completeness, and leave the maintaining burden where it belongs.

When choosing a theme, you say:

Note: make sure you click "Use SSH" on the popup box then copy the SSH key.

This is also not necessarily true. If you are not going to push to a repository (which is probably the case as you are cloning something where you might have no writing rights anyway) then authentication is not the main problem. The https clone works just as well.

The rest of it is definitely on point. Personally I chose gitlab for my free website hosting because, mainly, a personal preference given the free repositories and free webhosting for each and every organization I create there. Ever since I read this post (thanks @effingkay ) I've been meaning to also try netlify, but sadly haven't have the time for it. Maybe you'd like to check it out!

Cheers!

Collapse
 
dgavlock profile image
Dillon • Edited

Thanks for your input! You're definitely right about installing brew and go. My intent was to make sure that the user had everything they needed to do this tutorial, but I agree that it might be getting into the details and best left to that Hugo page! I will make the edit! Thanks again!

Collapse
 
tomtolleson profile image
Tom Tolleson

This is great, thanks Dillon.

One feature I'd love to implement on a Hugo Github pages site is the ability to dynamically list my repos from the Github API with links to the repos and description. That really enhances the portfolio aspect of it, I think. In Jekyll it would be

{% for repository in site.github.public_repositories %} {{ repository.name }}

{{ repository.description }}

{% endfor %}


`

I've found Go modules that do the same but for Hugo beginners it might be nice to include that feature (assuming there is a fairly simple way to do that).

Collapse
 
dbjdbj profile image
DBJDBJ • Edited

"...Now cd .. to go to the Sites directory ..." .. I have no "Sites" directory above the local hugo project root "directory" ... ?

Also. Before HUGO I had this GitHub account for years. Full of repo's and it already has dbjdbj.github.io/ ... And I do not want to loose that. Are we saying I need new github account to be abple to publish on the GitHub, Hugo made site?

Please advise ...

Collapse
 
dgavlock profile image
Dillon

Hey dbj!

"Sites was the working directory we created in the beginning of the tutorial. If you didn't make a "Sites" working directory just replace "Sites" with the directory you placed your files in.

For using your dbjdbj account I'm pretty sure you can create more Github Pages using a project page. FOr more informations regarding project pages check this out:

help.github.com/en/articles/user-o...

I haven't used HUGO for a project page but it is worth a shot!

Hope this helps!

Collapse
 
33nano profile image
Manyong'oments

This post is a true blessing

Collapse
 
bayuangora profile image
Bayu Angora

I can build Jekyll easily on github.io without any local development first. How to build Hugo on github.io in the same way?

Collapse
 
hpj1992 profile image
Harshit

Thanks. This official docs is also improved now gohugo.io/hosting-and-deployment/h...

Collapse
 
navidrashidian profile image
navidrashidian

Which steps should I redo when I want to add new content?