Hugo博客搭建记录
文章目录
本地搭建流程
hugo new site blog
cd blog
git clone https://github.com/olOwOlo/hugo-theme-even themes/even
更改文件位置exampleSite
hugo server –theme=even –buildDrafts
部署到远端githu
hugo –theme=even –baseUrl=“https://junzhoublog.github.io/"
cd public
git init
git remote add origin https://github.com/junzhoublog/junzhoublog.github.io.git
git add -A
cd ../..
git config –global user.email “1158290245@qq.com”
git config –global user.name “junzhoublog”
cd blog\public
git commit -m “first commit”
git push -u origin master
新建博客
cd blog
hugo new content/post/about.md
draft: false
tags: [“preview”, “中文”, “tag-1”]
categories: []
author: “周军”
toc: true
contentCopyright: cdut
toc :true # 是否开启目录
autoCollapseToc: false # 目录自动展开/折叠
fancybox : true # 是否启用fancybox(图片可点击)
mathjax : true # 是否使用mathjax(数学公式)
mathjaxEnableSingleDollar : true # 是否使用 $…$ 即可進行inline latex渲染
mathjaxEnableAutoNumber : true # 是否使用公式自动编号
hiddenFromHomePage: true
md语法
突出显示引用 > >> >>>
标题 # ##
换行 两个空格键
代码 c
加粗
1
|
** ** |
斜体
1
|
* * |
删除线 ~~ ~~
分割线 —
超链接
1
|
[百度](http://baidu.com) |
列表
1 2 3 |
- 列表内容 + 列表内容 * 列表内容 |
列表嵌套三个空格
表格
1 2 3 4 5 |
| 姓名 | 技能 | 排行 | | ---- | :---: | ---: | | 刘备 | 哭 | 大哥 | | 关羽 | 打 | 二哥 | | 张飞 | 骂 | 三弟 | |
添加音乐
1
|
{{% music "28196554" %}} |
添加图片
1
|
 |
数学公式
1
|
$ $ |
发布
–生成静态页面
hugo –theme=even –buildDrafts –baseUrl=“https://junzhoublog.github.io/”
—发布
cd public
git add .
git commit -m “new blog added”
git push origin master
bat 脚本一键发布
1 2 |
cd blog & hugo --theme=even --buildDrafts --baseUrl="https://junzhoublog.github.io/" & cd public & git add . & git push pause>nul |
markdown all in one 使用
- 特点 提供常用操作的快捷键 支持目录 支持同步预览(ctrl+shift+v) 轻松转换html和pdf文件 可格式化table(alt+shift+f)和task list(alt+c) 支持特殊数学符号渲染
- 常用快捷键 粗体 ctrl+b
斜体 ctrl+i
删除线 alt+s
切换数学环境 ctrl+m
同步预览 ctrl+shift+v
检查任务列表项 alt+c
格式化表格 alt+shift+f
格式化任务列表 alt+c
- 常用命令 先按F1进入VSCode命令面板
自动创建目录 Create Table of Contents 更新目录 Update Table of Contents 添加/更新标题编号 Add/Update Section numbers
文章作者 周军
上次更新 2019-08-31