第一个Blog,作为测试
Blog搭建参考Argvchs's blog的Hexo 博客搭建教程 III和ParticleX 主题使用说明 采用了Hexo框架和ParticleX主题
因为Cloudflare Pages缺少pandoc
的后端渲染程序支持,本站目前采取以下部署方式: Hexo源码 -> Github仓库A -> Github Action -> 静态页面(Github仓库B) -> 自动抓取 -> 网页公网部署(Cloudflare Pages)
测试内容
以下为测试内容:
Katex测试
已启用tex-copy,可以直接复制得到tex代码 \[\LaTeX测试\] \[ \begin{aligned} &a_n = a_1q^{n-1}= \frac {a_1}{q} \cdot q^n(n \in N^*) \\[1em] &其中前 n 项的和公式为:\\[1em] &S_n = \left\{ \begin{align} \frac {a_1 \cdot (1-q^n)}{1-q} &,q \neq 1 \\ na_1 &,q=1 \end{align} \right. \end{aligned} \] \[ \begin{gather*} \begin{matrix} 0 & 1 \\ 1 & 0 \end{matrix}\quad \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}\\ \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}\quad \begin{Bmatrix} 1 & 0 \\ 0 & -1 \end{Bmatrix}\\ \begin{vmatrix} a & b \\ c & d \end{vmatrix}\quad \begin{Vmatrix} i & 0 \\ 0 & -i \end{Vmatrix} \end{gather*} \] \[ \sum_{k=1}^n k^2 = \frac{1}{2} n (n+1) \] \[ \begin{array}{l} \int k \, \text{d}x = kx + C \\ \int x^\mu \, \text{d}x = \frac{x^{\mu+1}}{\mu+1} + C, \quad (\mu \neq -1) \\ \int \frac{1}{x} \, \text{d}x = \ln \left| x \right| + C \\ \int \frac{1}{1+x^2} \, \text{d}x = \arctan x + C \\ \int \frac{1}{\sqrt{1-x^2}} \, \text{d}x = \arcsin x + C \end{array} \] \[ \overrightarrow{P_0P} \ \underrightarrow{P_0P} \ \overline{P_0P} \]
H2O is a liquid. 210 is 1024.
图片测试
通过markdown
通过内嵌HTML
HDR图片测试
图表&代码测试
原主题无mermaid支持,这里修改了主题源代码并引入(异步加载)
// https://github.com/theme-particlex/hexo-theme-particlex/blob/master/source/js/lib/highlight.js
let codes = document.querySelectorAll("pre");
for (let i of codes) {
let language = [...i.classList, ...i.firstChild.classList][0] || "plaintext";
const code = i.textContent;
if (language == 'mermaid') {
const mermaid = document.createElement("div");
mermaid.classList.add("mermaid");
mermaid.textContent = code;
i.replaceWith(mermaid);
} else {
if (language.startsWith('language-')) {
language = language.substring(9);
} else {
i.classList.remove(language); // 添加前缀,避免冲突
i.classList.add('language-' + language);
}
// 处理 spoiler
if (i.parentElement && i.parentElement.tagName === "DIV" && i.parentElement.classList.contains("spoiler-content") && i.parentElement.childElementCount === 1) {
const div = document.createElement("div");
div.classList = i.classList;
i.replaceWith(div);
i = div;
}
let highlighted;
if (hljs.getLanguage(language)) {
highlighted = hljs.highlight(code, { language }).value;
} else {
highlighted = i.firstChild.innerHTML;
}
i.innerHTML = `
<div class="code-content hljs">${highlighted}</div>
<div class="language">${language}</div>
<div class="copycode">
<i class="fa-solid fa-copy fa-fw"></i>
<i class="fa-solid fa-check fa-fw"></i>
</div>
`;
let content = i.querySelector(".code-content");
hljs.lineNumbersBlock(content, { singleLine: true });
let copycode = i.querySelector(".copycode");
copycode.addEventListener("click", async () => {
if (this.copying) return;
this.copying = true;
copycode.classList.add("copied");
await navigator.clipboard.writeText(code);
await this.sleep(1000);
copycode.classList.remove("copied");
this.copying = false;
});
}
}
graph TB
1((1))---21((2))---31((3))---41((4))
21--- n(( ))
31--- n1(( ))
1((1))---22((2))---n2(( ))
22---32((3))
graph TB
1((1))---21((2))---31((3))---41((4))
21--- n(( ))
31--- n1(( ))
1((1))---22((2))---n2(( ))
22---32((3))
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop HealthCheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]
mindmap
root((mindmap))
Origins
Long history
::icon(fa fa-book)
Popularisation
British popular psychology author Tony Buzan
Research
On effectiveness<br/>and features
On Automatic creation
Uses
Creative techniques
Strategic planning
Argument mapping
Tools
Pen and paper
Mermaid
xychart-beta
title "Sales Revenue"
x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis "Revenue (in $)" 4000 --> 11000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
excludes weekends
%% (`excludes` accepts specific dates in YYYY-MM-DD format, days of the week ("sunday") or "weekends", but not the word "weekdays".)
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :until isadded
Functionality added :milestone, isadded, 2014-01-25, 0d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page :20h
Add another diagram to demo page :48h
脚注测试
《出师表》(节选)
先帝1创业2未半而中道3崩殂4,今5天下三分6,益州疲弊7,此8诚危急存亡之秋也。然9侍卫之臣不懈于内,忠志之士忘身10于外者,盖追先帝之殊遇11,欲报之于陛下也。诚12宜开张圣听13,以光14先帝遗德,恢弘15志士之气,不宜妄自菲薄16,引喻失义17,以塞忠谏之路也18。
先帝:指汉昭烈帝刘备。先,尊称死去的人。↩︎
创:开创,创立;业:统一天下的大业。↩︎
中道:中途。↩︎
崩殂(cú):死。崩,古时指皇帝死亡。殂,死亡。↩︎
今:现在。↩︎
三分:天下分为孙权,曹操,刘备三大势力。↩︎
益州疲弊:弱,处境艰难;益州:汉代行政区域十三刺史部之一,包括今四川省和陕西省一带,这里指蜀汉。疲弊(pí bì):人力缺乏,物力缺无,民生凋敝。↩︎
此:这;诚:的确,实在;之:的;秋:时,时候,这里指关键时期,一般多指不好的。↩︎
然:然而;侍:侍奉;卫:护卫;懈:松懈,懈怠;于:在;内:皇宫中。↩︎
忘身:舍身忘死,奋不顾身。↩︎
盖:原来;追:追念;殊遇:优待,厚遇。↩︎
诚:的确,确实;宜:应该。↩︎
开张圣听:扩大圣明的听闻,意思是要后主广泛地听取别人的意见;开张,扩大。↩︎
光:发扬光大,用作动词;遗德:留下的美德。↩︎
恢弘:发扬扩大,用作动词。恢,大。弘,大,宽,这里是动词,也做“恢宏”;气:志气。↩︎
妄自菲薄:过于看轻自己;妄:过分;菲薄:小看,轻视。↩︎
引喻失义:讲话不恰当。引喻:称引、譬喻;喻:比如;义:适宜、恰当。↩︎
以:以致(与以伤先帝之明的以用法相同:以致);塞:阻塞;谏:劝谏。↩︎