Install Hugo and theme https://github.com/lingxz/er.
brew install hugo
# verify
hugo version
# blog will be the git folder
hugo new site blog
cd blog/themes
git clone https://github.com/lingxz/er.git
rm -rf er/.git
cd ..
echo 'theme = "er"' >> config.toml
Add the a post and test locally,
hugo new posts/my-first-post.md
echo 'Hello Hugo!' >> content/posts/my-first-post.md
hugo server -D
Create a repo on Github.
Github Pages provides two types of sites. But,
You cannot choose a different publishing source for user or organization sites. ^1
The following steps assume you’re using “project site”.
If you want to use “user or organization sites”, you need another way to manage your raw contents and public static website.
Change baseURL
in config.toml
to https://d4rkb1ue.github.io/blog
Press Ctrl+C to stop server.
Publish to a new Github Repo.
git init
hugo -D -d docs
git commit -am"init"
# change to your own git url
git remote add origin [email protected]:d4rkb1ue/blog.git
git push -u origin
Set your Github Repo,
- Go
Settings
panel ->GitHub Pages
section - Change
Source
tomaster branch /docs folder
Test your blog in your browser,
*Optionally, you can also change to a custom domain,
- Go to your Domain DNS provider, add/change the record for the domain you choose to
d4rkb1ue.github.io
(d4rkb1ue
should be changed to your Github username)- For apex domain, make a CNAME record with Name
drkbl.com
, and Contentd4rkb1ue.github.io
- For subdomain, make a CNAME record with Name
blog
(anything you want), and Contentd4rkb1ue.github.io
.
- For apex domain, make a CNAME record with Name
- edit
baseURL
inconfig.toml
echo drkbl.com > docs/CNAME
git push
- Visit your custom domain!