hugo搭建個人博客


本地先安裝git

1. 下載hugo,並配置好環境變量

我這里win7 64位,選擇該版本下載

將解壓后的hugo.exe,配置到環境變量中,如下圖所示表明配置成功

hugo version

2. 生成本地站點

hugo new site wiki

3. 選擇主題

這里選擇其中一款

cd wiki
cd themes
git clone https://github.com/dplesca/purehugo.git

4. 新建文章

hugo new post/my_first_blog.md

寫入markdown內容

5. 預覽

hugo server --theme=purehugo --buildDrafts
http://localhost:1313/purehugo/


至此本地編寫博客基本完成

6. 創建碼雲項目

可以參考該文檔
這里創建項目名應為an1993不需要an1993.gitee.io

配置config.toml

baseurl = "https://an1993.gitee.io/"
languageCode = "zh-CN"
title = "足跡人生"
theme = "purehugo"
Paginate = 10
disqusShortname = "john"

[params]

7. 生成靜態頁面

hugo --theme=purehugo

此時生成public目錄

8. 將public目錄push到碼雲創建的倉庫中去

cd public/
git init
git add .
git commit -m "first commit"
git remote add origin git@gitee.com:an1993/an1993.gitee.io.git
git push -u origin master

9.開啟碼雲的page服務

10. 部署完成


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM