安装 go
先在 https://go.dev/doc/install
下载压缩包,然后进行安装
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
后面还需要修改 bashrc
,修改环境变量。
安装 hugo
sudo snap install hugo
quickstart
生成一个最简单的网页
hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
echo "theme = 'ananke'" >> config.toml
hugo server
第一个测试文章
- 生成
hugo new posts/my-first-post.md
- 修改,
vim content/posts/my-first-post.md
添加以下内容
## Introduction
This is **bold** text, and this is *emphasized* text.
Visit the [Hugo](https://gohugo.io) website!
- 因为上面是草稿,想要看到草稿需要允许草稿启动
hugo server --buildDrafts
或者hugo server -D
配置文件修改
config.toml
这个里面可以修改网站基本的一些设置。
生成
hugo
就可以生成所需文件,放在 public
文件夹下。 可以浏览器打开这个文件夹下的 index.html
来查看。
参考:
Download and install
https://go.dev/doc/install
Install Hugo on Linux.
https://gohugo.io/installation/linux/
gohugo-theme-ananke
https://github.com/theNewDynamic/gohugo-theme-ananke
Basic usage
https://gohugo.io/getting-started/usage/#draft-future-and-expired-content
Quick Start
https://gohugo.io/getting-started/quick-start/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律