第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 --buildDraftshugo server -t shadocs --buildDrafts四:创建章节页面
主题提供了为您的网站创建骨架的原型。
hugo new --kind chapter 个人笔记/_index.md五:创建您的第一个内容页面
然后,在之前创建的章节中创建内容页面。以下是在本章中创建内容的两种方法:
hugo new 开源工具/小工具推荐/_index.mdhugo new basics/first-content.md通过添加一些示例内容并替换文件开头的值来编辑这些文件。title
六:在本地启动网站
使用以下命令启动:
hugo server转到http://localhost:1313
您应该注意三件事:
- 您有一个左侧的“基本”菜单,其中包含两个子菜单,其名称与先前创建的文件中的属性相同。title
- 页说明了如何按照说明对其进行自定义。
- 跑步时hugo serve,当文件内容发生更改时,页面会自动刷新。整洁!
建立网站 当站点准备好部署时,请运行以下命令:
hugo四:克隆主题到本地
git clone https://github.com/zhaohuabing/hugo-theme-cleanwhite.gitgit clone https://github.com/McShelby/hugo-theme-relearn.git2:或者
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" --buildDraftscd public检查配置信息
git config --global --list创建文章
hugo new post/my-post.md指向当前主题路径
echo "theme = 'paper'" >> hugo.toml或者:
hugo server -t hugo-theme-cleanwhite --buildDrafts2:启动雨果的开发服务器来查看网站
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