这是一个自用的Markdown语法基础文章,用来预览有时记不清写法而用!
# 一级标题## 二级标题### 三级标题#### 四级标题##### 五级标题###### 六级标题
*斜体***粗体*****加粗斜体***~~删除线~~
效果:
斜体
粗体 加粗斜体 删除线
#三个或者三个以上的 - 或者 * 都可以。以下的几个效果都是一样的-------********
欢迎来到[陌上花的小站](https://imoshanghua.github.io/)欢迎来到[陌上花的小站](https://moshanghua.net/ "陌上花开")
我的个人博客:[陌上花的小站][1],[陌上花的小栈][2],[陌上花开][陌上花开]。[1]:http://moshanghua.net[2]:https://imoshanghua.github.io/ "陌上花开缓缓归矣!"[陌上花开]:https://moshanghua.net
<https://moshanghua.net>
## 跳转测试{#index}跳转到[跳转测试](#index)
+ 无序列表项- 无序列表* 无序列表项
效果:
1. 有序列表2. 有序列表
效果:
上一级和下一级之间敲四个空格即可1. 有序列表 - 无序列表2. 有序列表 - 无序列表
效果:
一行写上定义,紧跟一行写上解释。解释的写法:紧跟一个缩进(Tab)代码块 1 Markdown: 轻量级文本标记语言,可以转换成html,pdf等格式
* 无序列表 > 这是引用* 无序列表 [这是一个链接](https://moshanghua.net)* [链接列表](https://moshanghua.net)更多使用情况可自己尝试!
效果:
> 陌上花开缓缓归矣
效果:
陌上花开缓缓归矣
只要根据层次加上不同数量的 >>> 陌上花开缓缓归矣>>>待我熬尽一日苦,喂你一口甜!
效果:
陌上花开缓缓归矣
待我熬尽一日苦,喂你一口甜!
![图片代替文本](https://src.moshanghua.net/img/bg1.jpg "动漫图")
效果:
![图片代替文本][3][3]: https://src.moshanghua.net/img/bg-5.jpg "动漫图"
效果:
Hexo本地预览使用命令`hexo s`
效果:
Hexo本地预览使用命令hexo s
\`` Programming language`x = 1sum = 0while x <= 100: sum += x x += 1print(sum)\```
效果:
x = 1sum = 0while x <= 100: sum += x x += 1print(sum)
这是个简单的表格First Header | Second Header | Third Header------------ | ------------- | ------------Content Cell | Content Cell | Content CellContent Cell | Content Cell | Content Cell
效果:
First Header | Second Header | Third Header |
---|---|---|
Content Cell | Content Cell | Content Cell |
Content Cell | Content Cell | Content Cell |
出于美观的考虑,可以把两端都包围起来| First Header | Second Header | Third Header || ------------ | ------------- | ------------ || Content Cell | Content Cell | Content Cell || Content Cell | Content Cell | Content Cell |
效果:
First Header | Second Header | Third Header |
---|---|---|
Content Cell | Content Cell | Content Cell |
Content Cell | Content Cell | Content Cell |
通过在标题分割行添加冒号`:`,你可以定义表格单元的对其格式:向左靠齐,居中和向右靠齐| First Header | Second Header | Third Header || :----------- | :-----------: | -----------: || Left | Center | Right || Left | Center | Right |
语法参考:流程图语法参考
在代码区块里面, & 、 < 和 > 会自动转成 HTML 实体,这样的方式让你非常容易使用 Markdown 插入范例用的 HTML 原始码
使用 Markdown[^1]可以效率的书写文档, 直接转换成 HTML[^2], 你可以使用 Leanote[^Le] 编辑器进行书写。[^1]:Markdown是一种纯文本标记语言[^2]:HyperText Markup Language 超文本标记语言[^Le]:开源笔记平台,支持Markdown和笔记直接发为博文
]]>$ hexo new [layout] <title>
此时会在~/blog/source/_post
目录下生成一个 title.md
的博客文件 ,然后使用vim或其它编辑器对你的文章做修改。
您可以在命令中指定文章的布局(layout),默认为 post
,可以通过修改 _config.yml
中的 default_layout
参数来指定默认布局。
$ hexo new xiaomo "title"
在执行这行指令时,Hexo 会尝试在 scaffolds
文件夹中寻找 xiaomo.md
,并根据其内容建立文章,所以可以新建几个博客模板文件放置在 scaffolds
文件夹下。
一个简单的示例如下:
---title: {{ title }}date: {{ date }}tags:categories:---
$ hexo new page xxx
$ hexo c[lean]$ hexo g[enerate]$ hexo s[erver]INFO Start processingINFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
启动之后http://localhost:4000 即可看到效果
$ hexo c[lean]$ hexo g[enerate]$ hexo d[eploy]
hexo命令支持简写,条件是只有一个匹配项,多个时可增加至两个字符去识别
hexo new
命令用于新建文章,一般可以简写为 hexo n
$ hexo new [layout] <title>
layout
可选参数,用以指定文章类型,若无指定则默认由配置文件中的 default_layout
选项决定
title
必填参数,用以指定文章标题,如果参数值中含有空格,则需要使用双引号包围
该命令的使用方式与 new 十分类似,您也可在命令中指定 layout 来指定布局。
$ hexo publish [layout] <title>
草稿默认不会显示在页面中,您可在执行时加上 --draft
参数,或是把 render_drafts
参数设为 true
来预览草稿。
hexo generate
命令用于生成静态文件,一般可以简写为 hexo g
$ hexo generate
-d
选项,指定生成后部署,与 hexo d -g
等价hexo server
命令用于启动本地服务器,一般可以简写为 hexo s
$ hexo server
-p
选项,指定服务器端口,默认为 4000
-i
选项,指定服务器 IP
地址,默认为 0.0.0.0
-l
, --log
启动日志记录,使用覆盖记录格式
-s
p 选项,静态模式 ,仅提供 public
文件夹中的文件并禁用文件监视
hexo deploy
命令用于部署网站,一般可以简写为 hexo d
hexo deploy
-g
选项,指定生成后部署,与 hexo g -d
等价hexo clean
命令用于清理缓存文件,是一个比较常用的命令
$ hexo clean
网站显示异常时可尝试此操作
【详细的Hexo使用教程可去食用官方文档】
]]>