## 安裝hugogit
1. 首先安裝hugogithub
brew install hugo
2. 查看hugo version瀏覽器
hugo version
3. 進入到workspace,而後建立一個hugo 的workspacebash
hugo new site quickstart # quickstart 爲你的自定義workspace的name
4. 而後給hugo選擇主題post
cd quickstart cd themes #進入到hugo的themes目錄下 git clone https://github.com/liuzc/LeaveIt.git #下載某一主題,固然也能夠選擇你喜歡的其餘主題
而後修改 cofig.toml 中的 theme字段爲LeaveIt。網站
theme = "LeaveIt"
5. 配置主題ui
cofig.toml url
[menu] [[menu.main]] name = "Blog" url = "/posts/" weight = 1 [[menu.main]] name = "Categories" url = "/categories/" weight = 2 [[menu.main]] name = "Tags" url = "/tags/" weight = 3 [[menu.main]] name = "About" url = "/about/" weight = 4
配置社交連接spa
[params.social] GitHub = "xxoo" Twitter = "xxoo" Email = "xxoo" Instagram = "xxoo" Wechat = "/images/me/wechat.jpeg" # Wechat QRcode image Facebook = "xxoo" Telegram = "xxoo" Dribbble = "xxoo" Medium = "xxoo"
6. 利用hugo new 建立新的博客code
$ hugo new post/test.md
7. 本地啓動hugo
hugo server -D
8. 在瀏覽器裏面訪問:http://localhost:1313/
## github pages
1. 在你的github上建立一個repository,點擊setting,查找github pages,你將會看到如下內容
2. 將https://gholly.github.io/blog/這個地址寫到hugo下的config.toml文件的baseUrl
3. 在hugo的根目錄下執行hugo命令
hugo # 構建你的 Hugo 網站,默認將靜態站點保存到 "public" 目錄。
4. 綁定github repository
cd public git init git remote add origin github.git//你的github倉庫地址 git add . git commit -m "" git push origin master
5. 訪問https://gholly.github.io/blog/