CodePoetry

Keep Simple

moxiaozui

一梦中十八年,见了酒色财气,人我是非,贪嗔痴爱,风霜雨雪。

莫笑醉

南风共酒
醒时牧笛
醉后渔歌

桃花莫笑蹉跎
诸葛北伐
梦得南柯

夕阳残照浮波
今朝花开
明日花落

红尘几度磋磨
孤舟听雨
僧庐晚钟

东篱把酒
煮酒烧红叶
采露净黄花

司马闲愁
月明送远客
晓风吹酒醒

胡笳断肠
离人心碎
塞鸿归秋

古风-天工AI音乐专辑

Author image huhan

Build Blog

Hugo + Github 搭建个人博客

个人博客

CodePoetry

QuickStart

安装 Hugo

Releases · gohugoio/hugo (github.com)

配置hugo环境变量

创建一个新的网站

// 命令行中进入工作目录
cd workspace
这样就在 /quickstart 目录里生成了初始站点
hugo new site quickstart

安装皮肤

皮肤列表

cd themes
git clone https://github.com/spf13/hyde.git

添加主题说明

在根目录下的 config.toml 文件中添加主题说明

echo 'theme = "hyde"' >> config.toml

运行Hugo

执行 Hugo 命令进行调试

hugo server --theme=hyde --buildDrafts

浏览器里打开: http://localhost:1313

部署

GitHub Pages

  • 在 Github Repository 的 Setting 页面,修改 Source 的选项为 master branch /docs folder

  • 修改配置文件 config.toml:Github Repository 的 Setting 页面找到我们的 Github Pages 的域名地址,回到 config.toml 文件,找到 baseUrl,填入上述地址

    baseURL = "https://yourusername.github.io/"
    
  • 打包网站到 /docs 文件夹

  • 上传代码至 master

常用命令

添加一个文章

hugo new posts/my-first-post.md

设置文章draft: false

启动 Hugo 服务器进行本地渲染

hugo server -D

打包网站到 /docs 文件夹

hugo -d docs

上传代码至 master

git add .
git commit -m "updates $(date)"
git push origin master

参考资料

使用 Hugo + Github 搭建个人博客 - 知乎 (zhihu.com)

Hugo中文文档 (gohugo.org)

syui/hugo-theme-air: cname : syui.cf (github.com)

Author image huhan

About

作者:胡晗

爱好:编程、写博客、唱歌、阅读、骑行

Github:MiChuan

Email:huhan@300624.cn

Author image huhan

sample

Hugo is the world’s fastest static website engine. It’s written in Go (aka Golang) and developed by bep, spf13 and friends.

Below you will find some of the most common and helpful pages from our documentation.

https://gohugo.io/documentation/