第1章

个人笔记

首先使用以下命令创建第一章页面

hugo new --kind chapter basics/_index.md

然后,在之前创建的章节中创建内容页面。以下是在本章中创建内容的两种方法

hugo new basics/first-content.md
hugo new basics/second-content/_index.md

在本地启动网站

 hugo serve

浏览器打开 [http://localhost:1313]

构建网站

当您的网站准备部署时,运行以下命令: hugo

罗马字母的第一个字母public将生成文件夹,包含您网站的所有静态内容和资产。它现在可以部署在任何网络服务器上.

一:查看安装版本

hugo version

二:安装Hugo ➡️ 已经安装就忽略

brew install hugo

三:创建本地站点 ➡️ 进入根目录

hugo new site My-6oo; cd My-6oo

克隆主题到本地

git clone https://github.com/McShelby/hugo-theme-relearn.git

指向当前主题路径

echo "theme = 'hugo-theme-relearn'" >> hugo.toml

或者

hugo server -t hugo-theme-relearn --buildDrafts
hugo server -t shadocs --buildDrafts

四:创建章节页面

主题提供了为您的网站创建骨架的原型。

hugo new --kind chapter 个人笔记/_index.md

五:创建您的第一个内容页面

然后,在之前创建的章节中创建内容页面。以下是在本章中创建内容的两种方法:

hugo new 开源工具/小工具推荐/_index.md
hugo new basics/first-content.md

通过添加一些示例内容并替换文件开头的值来编辑这些文件。title

六:在本地启动网站

使用以下命令启动:

hugo server

转到http://localhost:1313

您应该注意三件事:

  1. 您有一个左侧的“基本”菜单,其中包含两个子菜单,其名称与先前创建的文件中的属性相同。title
  2. 页说明了如何按照说明对其进行自定义。
  3. 跑步时hugo serve,当文件内容发生更改时,页面会自动刷新。整洁!

建立网站 当站点准备好部署时,请运行以下命令:

hugo

四:克隆主题到本地

git clone https://github.com/zhaohuabing/hugo-theme-cleanwhite.git
git clone https://github.com/McShelby/hugo-theme-relearn.git

2:或者

cd myblog/themes 把exampleSite文件夹内容复制到根目录

cp -r relearn/exampleSite/** ../
cd ..

五:运行指定主题

hugo server -t relearn --buildDrafts

六:创建github仓库

hugo --theme=hugo-theme-cleanwhite --baseURL="https://6oo-cn.github.io" --buildDrafts
cd public

检查配置信息

git config --global --list

创建文章

hugo new post/my-post.md

指向当前主题路径

echo "theme = 'paper'" >> hugo.toml

或者:

hugo server -t hugo-theme-cleanwhite --buildDrafts

2:启动雨果的开发服务器来查看网站

hugo server --buildDrafts

hugo server -D

发布博客到Github Pagesgit

一:克隆git仓库到本地

git clone git@github.com:6oo-cn/6oo-cn.github.io.git

二:制作软链接

Ln -s /Users/6oo-cn/wwwblog/6oo-cn.github.io /Users/6oo-cn/wwwblog/public

三:初始化已存在的 Git 仓库

git init
1: hugo
2: cd 6oo-cn.github.io
3: git status
4: git add *
5: git status
6: git commit -m "我的第2次提交"
7 :git push

二次提交从 4 步开始


创建ssh keys

ssh-keygen -t rsa -b 1718 -C "vip.6oo@qq.com"

回车三次

cat ~/.ssh/id_rsa.pu