Getting Started With Hugo

Step 1: Install Hugo

brew install hugo

To verify your new install:

hugo version

Step 2: Create a New Site

hugo new site quickstart

The above will create a new Hugo site in a folder named quickstart.

Step 3: Add a Theme

See themes.gohugo.io for a list of themes to consider. This quickstart uses the beautiful Ananke theme.

cd quickstart;\
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

Step 4: Add Some Content

hugo new posts/my-first-post.md

Edit the newly created content file if you want. Now, start the Hugo server with drafts enabled:

▶ hugo server -D

Started building sites ...
Built site for language en:
1 of 1 draft rendered
0 future content
0 expired content
1 regular pages created
8 other pages created
0 non-page files copied
1 paginator pages created
0 categories created
0 tags created
total in 18 ms
Watching for changes in /Users/bep/sites/quickstart/{data,content,layouts,static,themes}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Navigate to your new site at http://localhost:1313/.

Step 5: Customize the Theme

Your new site already looks great, but you will want to tweak it a little before you release it to the public.

Site Configuration

Open up config.toml in a text editor:

baseURL = "https://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "ananke"

Replace the title above with something more personal. Also, if you already have a domain ready, set the baseURL. Note that this value is not needed when running the local development server.

Tip: Make the changes to the site configuration or any other file in your site while the Hugo server is running, and you will see the changes in the browser right away.

For theme specific configuration options, see the theme site.

For further theme customization, see Customize a Theme.


雙子星雲端運算公司在經濟部鼓勵與工研院的全力支持下,獲得國內多家知名創投與企業法人肯定予以投資,正式成立新創公司。
積極投入自主研發雲端系統軟體與雲端應用服務整合平台。

contact@geminiopencloud.com 新竹市東區公道五路二段158號11樓之3 03-659-0698 Facebook