Markdown Template
这是用于测试Jekyll主题下的Markdown模板。会被其它文章继承。
该文档参考至 模板说明
由于该网页基于Jekyll主题(由Liquid编写),因此支持在Markdown中使用Liquid标签和 Liquid相关语法
更多源生Markdown语法请参考:Markdown Guide 和 菜鸟教程
本地测试使用command:
bundle exec jekyll s
原生Markdown
三级标题
四级标题
五级标题
六级标题
图片插入
本地图片(建议还是写全路径):
网络图片:
表格
长表格:
| 表头1 | 表头2 | 表头3 | 表头4 | 表头5 | 表头6 | 表头7 | 表头1 | 表头2 | 表头3 | 表头4 | 表头5 | 表头6 | 表头7 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 内容1 | 内容2 | 内容3 | 内容4 | 内容5 | 内容6 | 内容7 | 内容1 | 内容2 | 内容3 | 内容4 | 内容5 | 内容6 | 内容7 |
简单表格:
| 表头1 | 表头2 | 表头3 |
|---|---|---|
| 内容1 | 内容2 | 内容3 |
列表
无序列表
- 无序列表1
- 无序列表2
- 无序列表3
有序列表
- 有序列表1
- 有序列表2
- 有序列表3
混合/嵌套列表
- 有序列表1
- 无序列表1
- 无序列表2
- 有序列表1
- 有序列表2
- 有序列表2
- 有序列表3
- 无序列表4
- 无序列表5
- 无序列表6
- 无序列表5
- 无序列表4
- 有序列表3
TODO列表
- 已完成任务
- 未完成任务
- 未完成子任务
引用/链接
LaTeX公式
这是一个行内公式:$E=mc^2$
这是一个块级公式:
\[E=mc^2\]代码块
1
2
def hello():
print("Hello, World!")
1
2
3
4
5
6
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "UnityCG.cginc"
#include "Lighting.cginc"
#pragma vertex vert
#pragma fragment frag
CBUFFER_START(UnityPerMaterial)
float4x4 unity_ObjectToWorld;
CBUFFER_END
struct appdata {
float4 vertex : POSITION;
};
struct v2f {
float4 vertex : SV_POSITION;
};
appdata vertex vert(appdata v) {
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
half4 fragment frag(v2f i) : SV_Target {
return float4(1, 1, 1, 1);
}
这是一段行内代码:print("Hello, World!")
这是一段支持高亮的文件路径:/path/to/file
Jekyll扩展特性
图片相关
图片宽高设置
{:width=”100px” height=”100px”}:
{:width=”50%” height=”50%”}:
图片位置
1测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字
3测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字 4测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字 5测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字 {: .left}: (左对齐,文字环绕) 5测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字 6测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字 7测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字
{: .right} (右对齐,文字环绕) 8测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字 9测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字 1测试用文字测试用文字测试用文字测试用文字测试用文字测试用文字
图片描述
黑暗/明亮模式图片
仅黑暗模式显示:
仅明亮模式显示:
图片阴影
图片占位符LQIP
Lqip用于图片懒加载,用于在图像完全加载之前显示在页面上。它通常是图像的模糊版本,或者是一个简单的占位符形状(如矩形或圆形),其主要目的是在图像加载过程中提供视觉反馈,防止页面出现空白。1
十分推荐使用,可以有效提升用户体验。2
提示框
An example showing the
tiptype prompt.
An example showing the
infotype prompt.
An example showing the
warningtype prompt.
An example showing the
dangertype prompt.
视频内嵌入
语法:
1
{ % include embed/{Platform}.html id='{ID}' %}
URL示例:
| Video URL | Platform | ID |
|---|---|---|
| https://www.youtube.com/watch?v=Ap0huJwyT7g?si=4BN5GglyU76yf-OL | YouTube | Ap0huJwyT7g?si=4BN5GglyU76yf-OL |
| https://www.bilibili.com/video/BV1Zj411D7so | Bilibili | BV1Zj411D7so |
| https://www.twitch.tv/videos/1634779211 | Twitch | 1634779211 |
YouTube视频:
其中id为视频的id,可以在视频链接中找到,如:https://www.youtube.com/watch?v=Ap0huJwyT7g?si=4BN5GglyU76yf-OL中的Ap0huJwyT7g?si=4BN5GglyU76yf-OL
Bilibili视频:
twitch视频:
如果要自定义/本地插入视频:
遵循以下语法:
1
{ % include embed/video.html src='{URL}' %}
插入视频所支持的属性:
- poster=’/path/to/poster.png’ — 这是在视频下载时显示的视频封面图像的路径
- title=’Text’ — 这是显示在视频下方的视频标题
- autoplay=true — 视频会在加载完成后立即自动播放
- loop=true — 是否循环播放
- muted=true — 是否初始为静音
types — 指定由 分隔的额外视频格式的扩展名。确保这些文件存在于主视频文件的同一目录中。
完整格式如下:
1
2
3
4
5
6
7
8
9
10
{ %
include embed/video.html
src='/path/to/video.mp4'
types='ogg|mov'
poster='poster.png'
title='Demo video'
autoplay=true
loop=true
muted=true
%}
音频内嵌入
音频内嵌入语法:
1
{ % include embed/audio.html url='{URL}' %}
完整格式如下:
1
2
3
4
5
6
{ %
include embed/audio.html
src='/path/to/audio.mp3'
types='ogg|wav|aac'
title='Demo audio'
%}
脚注引用
始终会显示在文章末尾:
