下载 hugo 软件

https://github.com/gohugoio/hugo/releases

hugo下载

我的环境是 centos7 64 位,所以选择 hugo_0.87.0_Linux-64bit.tar.gz

解压部署

$ tar xvf hugo_0.87.0_Linux-64bit.tar.gz -C hugo
$ cd hugo
$ cp hugo /usr/local/bin/

创建博客目录

hugo new site hugoblog

这样就创建了一个博客网站目录,并生成了必要的目录和配置文件

[root@Box ~]# tree hugoblog/
hugoblog/
├── archetypes
│   └── default.md
├── config.toml
├── content
├── data
├── layouts
├── static
└── themes

6 directories, 2 files

下载主题

$ cd themes/
$ git clone https://gitee.com/lyndon2/maupassant-hugo.git
$ mv maupassant-hugo/ maupassant

修改配置文件

[root@Box hugoblog]# cat config.toml
languageCode = "en-us"
title = "Lyndon's Blog"
theme = "maupassant"

summaryLength = 70
hasCJKLanguage = true

#保持分类的原始名字(false会做转小写处理)
preserveTaxonomyNames = true

[author]
        name = "Lyndon"

[params]
        localSearch = true
        author = "Lyndon"
        #busuanzi = true

[menu]
        [[menu.main]]
                identifier = "about"
                name = "关于"
                url = "/about/"
                weight = 4
        [[menu.main]]
                identifier = "archives"
                name = "归档"
                url = "/archives/"
                weight = 3

[markup]
        [markup.highlight]
                #lineNos = true
                #style = "github"
                #style = "monokai"
                #style = "solarized-light"
                style = "monokailight"

[params.utteranc]
    enable = true
    repo = "liyongjun123/hugo-blog-issue"    # 存储评论的Repo,格式为 owner/repo
    issueTerm = "pathname"  #表示你选择以那种方式让github issue的评论和你的文章关联。
    theme = "github-light" # 样式主题,有github-light和github-dark两种

运行

hugo server -w --baseURL=http://192.168.1.29:8088 --bind=0.0.0.0 --port=8088