添加源
[root@iZ2zeflzb6atg5mhyyxn7oZ ~]# vim /etc/yum.repos.d/hugo.repo [daftaupe-hugo] name=Copr repo for hugo owned by daftaupe baseurl=https://copr-be.cloud.fedoraproject.org/results/daftaupe/hugo/epel-7-$basearch/ type=rpm-md skip_if_unavailable=True gpgcheck=1 gpgkey=https://copr-be.cloud.fedoraproject.org/results/daftaupe/hugo/pubkey.gpg repo_gpgcheck=0 enabled=1
安装Hugo
[root@iZ2zeflzb6atg5mhyyxn7oZ ~]# yum install hugo -y
- 查看版本
[root@iZ2zeflzb6atg5mhyyxn7oZ ~]# hugo version Hugo Static Site Generator v0.69.0 linux/amd64 BuildDate: 2020-04-15T08:34:19Z
安装主题
- 建立项目
[root@iZ2zeflzb6atg5mhyyxn7oZ ~]# hugo new site dot Congratulations! Your new Hugo site is created in /root/dot. Just a few more steps and you're ready to go: 1. Download a theme into the same-named folder. Choose a theme from https://themes.gohugo.io/ or create your own with the "hugo new theme <THEMENAME>" command. 2. Perhaps you want to add some content. You can add single files with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>". 3. Start the built-in live server via "hugo server". Visit https://gohugo.io/ for quickstart guide and full documentation.
- 添加主题
[root@iZ2zeflzb6atg5mhyyxn7oZ ~]# cd /root/dot/themes/ [root@iZ2zeflzb6atg5mhyyxn7oZ themes]# git clone https://github.com/themefisher/dot-hugo-documentation-theme.git
- 重命名文件
[root@iZ2zeflzb6atg5mhyyxn7oZ themes]# mv dot-hugo-documentation-theme dot
- 移动配置文件到根目录下
[root@iZ2zeflzb6atg5mhyyxn7oZ themes]# pwd /root/dot/themes [root@iZ2zeflzb6atg5mhyyxn7oZ themes]# cd dot/ [root@iZ2zeflzb6atg5mhyyxn7oZ dot]# cd exampleSite/ [root@iZ2zeflzb6atg5mhyyxn7oZ exampleSite]# mv * /root/dot/ mv: overwrite ‘/root/dot/config.toml’? yes mv: overwrite ‘/root/dot/content’? yes mv: overwrite ‘/root/dot/static’? yes
- 启动
[root@iZ2zeflzb6atg5mhyyxn7oZ ~]# cd dot/ [root@iZ2zeflzb6atg5mhyyxn7oZ dot]# [root@iZ2zeflzb6atg5mhyyxn7oZ dot]# hugo serve --bind=10.0.0.126 --port=1313
- 查看
继续阅读
- 我的QQ
- QQ扫一扫
-
- 我的头条
- 头条扫一扫
-
评论