嘿! 歡迎滑到我的 Matter ,這裡紀錄這我的技術blog的內容。我喜歡透過文字紀錄來搭建個人知識庫,也可以和各位交流看法。文章大多偏向Web3.0的內容,有興趣的話可以訂閱我。 Telegram: https://t.me/yanglin94
Hugo建立部落格/網站
Hugo是什麼
Hugo是用go語言開發的靜態網站的生產器 (Static Site Generator),有快速的架站速度和高靈活性。
安裝
Hugo有很多安裝方式,有Windows/macOS/Linux,這裡主要介紹Window和macOS的安裝方法,其他安裝方法請直接到官網查詢。
Scoop (Windows)
scoop install hugo scoop install hugo-extended
Homebrew (macOS)
brew install hugo
建立網站
hugo new site webside
布置主題
Hugo沒有預設主題需到官網Themes下載。
使用git下載
cd wibside git init git submodule add https://github.com/liuzc/LeaveIt.git
沒有也沒關係,下載LeaveIt Themes後解壓縮。
編輯config.toml將主題設為LeaveIt
開啟config.toml輸入
theme = "LeaveIt"
也可將LeaveIt檔案裡的exampleSite/config.toml剪下覆蓋原檔案。
建立新文章
hugo new posts/my-first-post.md
文章會在/content目錄中
啟動台
hugo server -D
Hugo預設port為http://localhost:1313/
部屬
當網站完成後,產生靜態檔案到public
資料夾下並部屬到遠端主機上。
各平台部署方式參考。
喜欢我的文章吗?
别忘了给点支持与赞赏,让我知道创作的路上有你陪伴。
发布评论…