[params.page.library][params.page.library.css]# someCSS = "some.css"# located in "assets/" 位于 "assets/"# Or 或者# someCSS = "https://cdn.example.com/some.css""APlayerCSS"="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"[params.page.library.js]# someJavascript = "some.js"# located in "assets/" 位于 "assets/"# Or 或者# someJavascript = "https://cdn.example.com/some.js""APlayerJS"="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js""MetingJS"="https://cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js"
➜ ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
➜ ~ arch
x86_64
➜ ~ go version
go version go1.18.3 linux/amd64
安装
1
sudo apt-get install hugo
或者 直接下载bin文件,然后解压到/usr/local/bin
1
sudo tar -zxvf /mnt/d/Ubuntu/hugo_extended_0.101.0_Linux-64bit.tar.gz -C /usr/local/bin
查看版本(注意:非extended版本不支持编译scss)
1
2
➜ ~ hugo version
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
生成网站
在磁盘中找一块风水宝地,开启自搭博客之旅
1
hugo new site my_blog
来个主题
我选的是even主题
1
2
3
4
5
6
cd my_blog
git clone https://github.com/olOwOlo/hugo-theme-even themes/even
rm -rf themes/even/.git
mv themes/even/exampleSite/content/* content/
mv themes/even/exampleSite/config.toml ./
hugo server --theme=even --buildDrafts -D
docker run -p 3307:3306 --name mysql --restart=always --privileged=true -v /g/docker/mysql/data:/var/lib/mysql -v /g/docker/mysql/conf:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=来个密码 -d mysql
兼容之前版本的密码认证,需要进入容器,root登录mysql;做以下操作,主机客户端才能连接
1
2
3
4
5
6
CREATEUSER'来个用户'@'%'IDENTIFIEDBY'来个密码';GRANTALLON*.*TO'上面的用户'@'%';ALTERUSER'上面的用户'@'%'IDENTIFIEDBY'来个密码'PASSWORDEXPIRENEVER;# 可以修改密码
# ALTER USER '上面的用户'@'%' IDENTIFIED WITH mysql_native_password BY '换个密码';
flushprivileges;