My First Post on Hugo with GitLab and Netlify

Notes on building my first Hugo site

* This page contains promotional content

I tried building a site using Hugo, GitLab and Netlify

Building the site

Prerequisites

  • A GitLab account is already registered
  • A Netlify account is already registered
  • hugo is already installed locally

Steps

  1. Create a repository on GitLab

  2. git clone it locally

  3. Create a new site with hugo

  4. Copy the directories and files created in 3. into the directory from 2.

  5. Create .gitignore

    .DS_Store
    public
  6. Install the theme

$ git submodule add https://github.com/halogenica/beautifulhugo.git beautifulhugo

The theme has been decided in advance, so copy it under the root

$ cp -r themes/beautifulhugo/exampleSite/* ./
$ cp -r themes/beautifulhugo/layouts ./
$ cp -r themes/beautifulhugo/static ./
  1. Check the site build locally
    $ hugo server
    ....
    Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
    This alone is enough to build the site, so open http://localhost:1313 in a browser and confirm that it is displayed Once you have confirmed it, stop hugo server with ctrl+c
  2. Update the repository
    $ git add .
    $ git commit .
    $ git push -u origin master

After this, I write articles, edit the settings and the layout, and keep updating the repository