ldipotetjob / mojitoverde

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. You have Hugo generator installed. (ref: how install hugo)
  2. 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

  1. 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
  2. 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
  3. Check that you are on $githubblogrepositoryname and then launch: hugo -D
  4. Commit and upload the changes to remote and have fun 👍

Some hugo references:

About


Languages

Language:HTML 93.9%Language:SCSS 3.9%Language:JavaScript 2.2%Language:Shell 0.1%