This article offers steps of building a website with Hugo and Hugo theme, syncing with Github, and publishing to Netlify . (Take this website 010309 as an example, please be careful to replace 010309 with your own website name)
Create a website
Run these commands from Git Bash to create a Hugo site with the [tailwind] theme.
hugo new site 010309
cd 010309
git init
git submodule add https://github.com/tomowang/hugo-theme-tailwind.git themes/tailwind
Edit Configuration
Open Visual Studio Code, open folder \010309. Delete hugo.toml. Copy \010309\themes\tailwind\config to \010309\config and edit the file hugo.toml.
baseURL = "https://010309.xyz/"
title = "010309: On January 3, 2009, Bitcoin officially came into existence when Satoshi Nakamoto mined the genesis block of Bitcoin (block number 0)."
author = "Ken"
copyright = "Ken"
paginate = 10
languageCode = "en"
defaultContentLanguage = "en"
enableInlineShortcodes = true
# prevent build failures when using Hugo's Instagram shortcode due to deprecated Instagram API.
# See https://github.com/gohugoio/hugo/issues/7228#issuecomment-714490456
ignoreErrors = ["error-remote-getjson"]
theme = "tailwind"
[markup]
_merge = "deep"
[taxonomies]
category = "categories"
tag = "tags"
series = "series"
[privacy]
[privacy.vimeo]
disabled = false
simple = true
[privacy.twitter]
disabled = false
enableDNT = true
simple = true
[privacy.instagram]
disabled = false
simple = true
[privacy.youtube]
disabled = false
privacyEnhanced = true
Debug the website
Click on New Terminal,Run:
hugo server
View your site at the URL displayed in your terminal ( It usually is http://localhost:1313/ ). Press Ctrl + C
to stop Hugo’s development server.
Push your code to Github
Create a Github repository 010309. Copy your SSH path ( for example, mine is git@github.com :Ken2626/010309.git). Run:
git add .
git commit -m "First submit."
git branch -M main
git remote add origin git@github.com:Ken2626/010309.git
git push -u origin main
publish to Netlify
Follow this instruction Host on Netlify