Hello Hugo
I have changed my blog to a hugo site and this is my first post using hugo.
Hugo Introduction
Hugo is a fast and modern static site generator written in Go, and I use it to build my blog. Here are some steps to build your own blog pages with Github Pages and Hugo, and it’s fast and all free.
Create two projects on Github
- Blog source, assuming
github.com/<username>/blog
- Generated blog static pages, assuming
github.com/<username>.github.io
Initialize github.com/<username>.github.io
with a README.md or anything else you like, while the source blog repo can be left empty.
Install hugo
Check docs on Hugo doc site
Build a new hugo site
|
|
Commit blog site into source repo
git init
git add .
git commit -m "first commit"
git remote add origin git@github.com:<username>/blog.git
git push -u origin master
Add a theme to your blog
git init;
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke;
# Edit your config.toml configuration file
# and add the Ananke theme.
echo 'theme = "ananke"' >> config.toml
To find more themes, go http://themes.gohugo.io/
Add some content and preview it
hugo new posts/my-first-post.md
New post is configurated as draft in meta data block, change it to false
when you finish editing and decide to publish it.
|
|
Start a local draft server to preview it at http://localhost:1313/
|
|
The flag -D
enables hugo to render draft pages.
Host hugo blog site on GitHub
- Remove your
public
directory in you blog source repo
|
|
- Use your generated static blog repo as a submodule of the source repo
|
|
- Use a deploy script to publish your generated pages
Save script as deploy.sh
in your source repo and run it to publish.
|
|
DONE
Now you can try to access your blog at https://<usename>.github.io