how to build your own blog using hugo.

documentations Link to heading

https://gohugo.io/getting-started/usage/ https://learn.netlify.com/en/

setup Link to heading

  1. install hugo following offical install guide.
    download packages from Hugo Release and put executale file hugo in PATH.

  2. execute hugo new site sitename, To create a new site. directory structure will like this:

.
├── archetypes
├── assets
├── config.toml
├── content
├── data
├── layouts
├── static
└── themes
  1. download theme from github. unzip the archive and copy files to you site dir, overwriting directory and files of the same name. you can change your website config by changing config.toml.

  2. wirte you first blog. hugo new content/first.md, will gen a markdown file in content. you can use hugo server -w to start a server locally, and visit localhost:1313 for preview.

  3. execute hugo, this will gen md files in dir content to html files in dir public.

  4. put your public directory in a nginx.

directorys in directory content will display as menu in the left. and file named _index.md is the default page of the directory.

example Link to heading

you can visit my github repo hugo-blog, the article itself is generated by this repo.

change theme Link to heading

you can change your styles by changing different themes. themes could be found at http://themes.gohugo.io.

overall Link to heading

overall, you can easily create your own doc/blog by follow command:

# create a new site
hugo new site mysite
cd mysite/
# create your first page
hugo new first.md
# build page
hugo

then you can find your site in directory public.