Hosting your static website generated by HUGO on a different source than your github page
We have a scenario where you are already using the default page http(s)://<username>.github.io
so
you need to change your publishing source.
The next path could be a very easy solution, our starting point:
- You have Hugo generator installed. (ref: how install hugo)
- You have created and configure github repository where you want save your blog info. (ref: creating and configuring Hugo static website)
Now let's check if everything went well. Deploy in local
hugo server -D
####
# ........
# Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
####
How our Hugo static website can be deployed on github page
- The hugo static site will need a binding to a github url publishing source:
In the config.toml file the key baseURL must have the github url
page
baseURL =http(s)://<username>.github.io/$githubblogrepositoryname
- The hugo static site will need to know the destination to generate the static site, this is a binding to github url
publishing source:
publishdir = "docs". This folder name must be the same that you configure on setting your githubblogrepository pages source
ref how configure publishing resources - Check that you are on $githubblogrepositoryname and then launch: hugo -D
- Commit and upload the changes to remote and have fun 👍
Some hugo references: