1
0

index.html 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374
  1. <!doctype html>
  2. <html>
  3. <markdown-html
  4. version="1.20.10"
  5. author="PJ568"
  6. repo="https://github.com/PJ-568/markdown.html"
  7. license="CC BY-SA 4.0 International"
  8. >
  9. </markdown-html>
  10. <head>
  11. <meta charset="utf-8" />
  12. <meta name="description" content="HTML read markdown" />
  13. <meta
  14. name="keywords"
  15. content="markdown, html, renderer, low-dependency, one-click deployment"
  16. />
  17. <meta name="author" content="PJ568" />
  18. <link
  19. rel="icon"
  20. type="image/svg+xml"
  21. href="data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDQ4IDQ4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cmVjdCB4PSI2IiB5PSI2IiB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHJ4PSIyLjI1IiBmaWxsPSIjMmU3ZDMyIiBzdHJva2U9IiMxYjVlMjAiIHN0cm9rZS13aWR0aD0iLjc1Ii8+CjxnIGZpbGw9IiNlOGY1ZTkiIHN0cm9rZS13aWR0aD0iLjA5Mzc1Ij4KPHJlY3QgeD0iOSIgeT0iMTIiIHdpZHRoPSIzMCIgaGVpZ2h0PSIxLjUiIHJ4PSIuMzc1Ii8+CjxyZWN0IHg9IjkiIHk9IjE1Ljc1IiB3aWR0aD0iMjYuMjUiIGhlaWdodD0iMS41IiByeD0iLjM3NSIvPgo8cmVjdCB4PSI5IiB5PSIxOS41IiB3aWR0aD0iMjIuNSIgaGVpZ2h0PSIxLjUiIHJ4PSIuMzc1Ii8+CjxyZWN0IHg9IjkiIHk9IjIzLjI1IiB3aWR0aD0iMzAiIGhlaWdodD0iMS41IiByeD0iLjM3NSIvPgo8cmVjdCB4PSI5IiB5PSIyNyIgd2lkdGg9IjI2LjI1IiBoZWlnaHQ9IjEuNSIgcng9Ii4zNzUiLz4KPHJlY3QgeD0iOSIgeT0iMzAuNzUiIHdpZHRoPSIyMi41IiBoZWlnaHQ9IjEuNSIgcng9Ii4zNzUiLz4KPHRleHQgeD0iMjQiIHk9IjM5LjM3NSIgZm9udC1mYW1pbHk9IidTYXJhc2EgVGVybSBTQyBOZXJkXFxcXFxcXFxcXFxcXFxcJycsICdNYXBsZSBNb25vIENOJywgVWJ1bnR1LCBSb2JvdG8sICdPcGVuIFNhbnMnLCAnTWljcm9zb2Z0IFlhSGVpJywgQXJpYWwsIHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iNC41cHgiIGZvbnQtd2VpZ2h0PSJib2xkIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj4mbHQ7TUgmZ3Q7PC90ZXh0Pgo8L2c+Cjwvc3ZnPgo="
  22. />
  23. <meta name="viewport" content="width=256, initial-scale=1" />
  24. <script
  25. defer
  26. src="https://lib.baomitu.com/marked/4.0.2/marked.min.js"
  27. type="application/javascript"
  28. ></script>
  29. <script
  30. src="https://lib.baomitu.com/pjax/0.2.8/pjax.min.js"
  31. type="application/javascript"
  32. ></script>
  33. <script
  34. src="https://lib.baomitu.com/translate.js/3.17.0/translate.js"
  35. type="application/javascript"
  36. ></script>
  37. <script
  38. src="https://lib.baomitu.com/Darkmode.js/1.5.7/darkmode-js.min.js"
  39. type="application/javascript"
  40. ></script>
  41. <script
  42. src="https://lib.baomitu.com/mermaid/8.14.0/mermaid.min.js"
  43. type="application/javascript"
  44. ></script>
  45. <script
  46. src="https://lib.baomitu.com/highlight.js/11.4.0/highlight.min.js"
  47. type="application/javascript"
  48. ></script>
  49. <script>
  50. // 使用 IIFE 包裹以避免全局变量污染
  51. (function () {
  52. function getVersion() {
  53. const markdownElement = document.querySelector("markdown-html");
  54. if (markdownElement) {
  55. const version = markdownElement.getAttribute("version");
  56. return version;
  57. } else {
  58. return "未知";
  59. }
  60. }
  61. function getAbout() {
  62. return `
  63. # 关于
  64. ## MARKDOWN.HTML
  65. 版本:${getVersion()}
  66. 旨在提供低依赖、一键部署的 Markdown 网页渲染方案。
  67. ### 特性
  68. - **依赖少**:仅需一个 HTML 文件,即可完成 Markdown 网页渲染。
  69. - **Markdown 支持**:将 Markdown 文件渲染为 HTML。
  70. - **Mermaid 支持**:将 Markdown 中的 Mermaid 语法渲染为图表。
  71. - **多语言支持**:支持多种语言间的机器互译。
  72. - **深色模式**:支持浅色、深色、跟随系统。
  73. - **Pjax 支持**:支持无刷新页面跳转。
  74. 详情请访问 [GitHub](https://github.com/PJ-568/MARKDOWN.HTML) 或 [Gitee](https://gitee.com/PJ-568/MARKDOWN.HTML) 仓库。
  75. `;
  76. }
  77. // 加载动画相关
  78. var loadingState = {
  79. countLoading: 0,
  80. };
  81. Object.defineProperty(loadingState, "countLoading", {
  82. get: function () {
  83. return this._countLoading;
  84. },
  85. set: function (newValue) {
  86. if (newValue < 0) {
  87. newValue = 0;
  88. }
  89. const loadingBar = document.querySelector(".loading-bar");
  90. const progress = document.querySelector(".loading-bar .progress");
  91. if (this.countLoading === 0 && newValue > 0) {
  92. var loadingBarWidth = 20;
  93. var MAX_LOADING_WIDTH = 95;
  94. loadingBar.classList.add("loading");
  95. progress.style.width = loadingBarWidth + "%";
  96. clearInterval(timer);
  97. timer = setInterval(function () {
  98. loadingBarWidth += 3;
  99. if (loadingBarWidth > MAX_LOADING_WIDTH) {
  100. loadingBarWidth = MAX_LOADING_WIDTH;
  101. }
  102. progress.style.width = loadingBarWidth + "%";
  103. }, 500);
  104. } else if (this.countLoading > 0 && newValue === 0) {
  105. clearInterval(timer);
  106. progress.style.width = "100%";
  107. loadingBar.classList.remove("loading");
  108. setTimeout(function () {
  109. progress.style.width = 0;
  110. }, 400);
  111. }
  112. this._countLoading = newValue;
  113. },
  114. });
  115. loadingState.countLoading = 0;
  116. function startLoad() {
  117. loadingState.countLoading = loadingState.countLoading + 1;
  118. }
  119. function endLoad() {
  120. loadingState.countLoading = loadingState.countLoading - 1;
  121. }
  122. var timer = null;
  123. // 文档解析功能相关
  124. var notExistIndexPage = null; // 是否不存在索引页
  125. var pValue = null;
  126. async function getPValue() {
  127. if (pValue) {
  128. return pValue;
  129. } else {
  130. return await decodeMDPath(window.location.href);
  131. }
  132. }
  133. // PJAX 相关
  134. let PJAX;
  135. // 深色模式相关
  136. let darkmode;
  137. // 自定义 PJAX 相关
  138. const existPushState = history && history.pushState;
  139. var level = 1; // 当前页面的层级
  140. var lastLevel = 0;
  141. // 初始化 PJAX
  142. function initPJAX() {
  143. try {
  144. const Pjax =
  145. window.Pjax ||
  146. function () {
  147. console.warn("Pjax 不存在?");
  148. };
  149. PJAX = new Pjax({
  150. selectors: ["head title", ".markdown-body", ".pjax-reload"],
  151. switches: {
  152. ".markdown-body": Pjax.switches.sideBySide,
  153. },
  154. switchesOptions: {
  155. ".markdown-body": {
  156. classNames: {
  157. remove:
  158. "Animated Animated-remove Animated--reverse Animate--fast Animate--noDelay",
  159. add: "Animated",
  160. backward: "Animate--slideInRight",
  161. forward: "Animate--slideInLeft",
  162. },
  163. },
  164. },
  165. cacheBust: false,
  166. });
  167. } catch (e) {
  168. console.error("PJAX 初始化出错:" + e);
  169. }
  170. }
  171. // translate-js 翻译系统
  172. //// 初始化翻译系统
  173. function initTranslate() {
  174. try {
  175. translate.service.use("client.edge");
  176. translate.request.listener.start();
  177. translate.setAutoDiscriminateLocalLanguage();
  178. translate.language.setUrlParamControl();
  179. translate.ignore.class.push("notTranslate");
  180. translate.execute();
  181. } catch (e) {
  182. console.error("翻译系统出错:" + e);
  183. }
  184. }
  185. // Darkmode.js 深色模式
  186. function initDarkmode() {
  187. try {
  188. const Darkmode =
  189. window.Darkmode ||
  190. function () {
  191. console.warn("Darkmode.js 不存在?");
  192. };
  193. darkmode = new Darkmode();
  194. } catch (e) {
  195. console.error("初始化 Darkmode.js 出错:" + e);
  196. }
  197. }
  198. //// 检查并提示翻译
  199. function infoTranslate() {
  200. try {
  201. const currentLang = translate.language.getCurrent();
  202. const originalLang = translate.language.getLocal();
  203. if (currentLang !== originalLang) {
  204. const translateInfo =
  205. document.querySelectorAll(".translate-info");
  206. if (translateInfo) {
  207. translateInfo.forEach(function (item) {
  208. item.remove();
  209. });
  210. }
  211. // 获取 .markdown-body 元素
  212. var bq = document.createElement("blockquote");
  213. bq.classList.add("translate-info");
  214. var infoBody = document.createElement("p");
  215. infoBody.innerText = "当前页面已翻译。您可以:";
  216. var msgBody = document.createElement("p");
  217. var switchButton = document.createElement("a");
  218. switchButton.classList.add("translate-switch");
  219. switchButton.href = "javascript:;";
  220. switchButton.title = "切换到原语言";
  221. switchButton.innerText = "切换到文章原本的语言";
  222. bq.appendChild(infoBody);
  223. bq.appendChild(switchButton);
  224. const mainElement = document.querySelector(
  225. ".markdown-body .content",
  226. );
  227. mainElement.insertBefore(bq, mainElement.children[1]);
  228. }
  229. } catch (e) {
  230. console.error("检查并提示翻译出错:" + e);
  231. }
  232. }
  233. //// 刷新翻译
  234. function refreshTranslate() {
  235. try {
  236. translate.selectLanguageTag.refreshRender();
  237. } catch (e) {
  238. console.error("刷新翻译出错:" + e);
  239. }
  240. }
  241. // 获取文件所在目录
  242. function getDirectory(path) {
  243. path = new URL(path, "http://example.com").pathname;
  244. const lastSlashIndex = path.lastIndexOf("/");
  245. return path.substring(0, lastSlashIndex + 1);
  246. }
  247. // 获取 markdown.html 当前所加载的 md 文件的所在路径
  248. function getPath() {
  249. return getDirectory(window.location.href);
  250. }
  251. // 将 ?p= 后面的值转换为绝对路径
  252. /*
  253. 输出的值是 /path/to/file.md
  254. 当其为 null 时,根据是否存在 index.md 文件来决定返回的值
  255. */
  256. async function decodeMDPath(path) {
  257. const url = new URL(path);
  258. const params = new URLSearchParams(url.search);
  259. path = formatMDPath(params.get("p"));
  260. return path;
  261. }
  262. // 格式化路径
  263. /*
  264. 如果 mdPath 为 null,则返回 null,如果 mdPath 是路径,则返回该路径下 /index.md
  265. return: 返回格式化后的文件路径,一定是绝对路径,或者 null
  266. */
  267. function formatMDPath(mdPath) {
  268. if (mdPath) {
  269. if (isRelativePath(mdPath)) {
  270. mdPath = getPath() + mdPath;
  271. }
  272. mdPath = new URL(mdPath, "http://example.com").pathname;
  273. if (!mdPath.endsWith(".md")) {
  274. if (!mdPath.endsWith("/")) {
  275. mdPath += "/";
  276. }
  277. mdPath += "index.md";
  278. }
  279. }
  280. return mdPath;
  281. }
  282. // 判断链接是否为外链
  283. function isExternalLink(url) {
  284. if (!url || typeof url !== "string") return false;
  285. //// 排除特殊协议
  286. const excludedProtocols = [
  287. "#",
  288. "javascript:",
  289. "mailto:",
  290. "tel:",
  291. "data:",
  292. ];
  293. if (excludedProtocols.some((proto) => url.startsWith(proto))) {
  294. return false;
  295. }
  296. try {
  297. const currentUrl = new URL(window.location.href);
  298. const targetUrl = new URL(url, currentUrl.origin);
  299. //// 排除非 HTTP(S) 协议
  300. if (!["http:", "https:"].includes(targetUrl.protocol)) return false;
  301. //// 域名统一转小写比较
  302. const currentHost = currentUrl.hostname.toLowerCase();
  303. const targetHost = targetUrl.hostname.toLowerCase();
  304. return currentHost !== targetHost;
  305. } catch (e) {
  306. return false;
  307. }
  308. }
  309. // 判断路径是否为相对路径
  310. function isRelativePath(path) {
  311. return !path.match(/^\//); //// 不以 / 开头
  312. }
  313. // 处理错误
  314. function updateContent(article, title = null, mdPath = pValue) {
  315. try {
  316. document.querySelector(".markdown-body").innerHTML =
  317. `<div class="old-content Animated Animated-remove Animated--reverse Animate--fast Animate--noDelay Animate--slideInLeft">${
  318. document.querySelector(".markdown-body .content").innerHTML
  319. }</div><div class="content Animated Animate--slideInRight">${article}</div>`;
  320. firstH1 = document.querySelector(".markdown-body .content h1");
  321. document.title = title
  322. ? title
  323. : firstH1
  324. ? firstH1.textContent
  325. : mdPath;
  326. } catch (error) {
  327. throw error;
  328. }
  329. }
  330. // 加载 CSS
  331. function loadCSS(url) {
  332. return new Promise((resolve, reject) => {
  333. //// 检查是否已加载
  334. const existingLinks = document.querySelectorAll(
  335. `link[href="${url}"]`,
  336. );
  337. if (existingLinks.length > 0) {
  338. return resolve(url);
  339. }
  340. //// 创建新的 link 元素
  341. const link = document.createElement("link");
  342. link.rel = "stylesheet";
  343. link.type = "text/css";
  344. link.href = url;
  345. //// 成功加载处理
  346. link.onload = () => {
  347. link.onload = null;
  348. link.onerror = null;
  349. resolve(url);
  350. };
  351. //// 加载失败处理
  352. link.onerror = () => {
  353. link.onerror = null;
  354. link.onload = null;
  355. document.head.removeChild(link);
  356. reject(new Error(`无法加载 CSS 文件:${url}`));
  357. };
  358. //// 添加到文档头部
  359. document.head.appendChild(link);
  360. });
  361. }
  362. // 等待动画结束
  363. function waitForAnimationsEnd(parentElement, selector, animationNames) {
  364. return new Promise((resolve) => {
  365. var completedCount = 0;
  366. const elements = parentElement.querySelectorAll(selector);
  367. const totalElements = elements.length;
  368. const handleAnimationEnd = function (event) {
  369. if (
  370. animationNames.includes(event.animationName) &&
  371. Array.from(elements).includes(event.target)
  372. ) {
  373. completedCount++;
  374. if (completedCount === totalElements) {
  375. parentElement.removeEventListener(
  376. "animationend",
  377. handleAnimationEnd,
  378. );
  379. resolve();
  380. }
  381. }
  382. };
  383. parentElement.addEventListener("animationend", handleAnimationEnd);
  384. });
  385. }
  386. // 处理错误
  387. function handleError(mdPath, errorMessage) {
  388. updateContent(
  389. `<h1>加载失败</h1><p>加载文档<code>${mdPath}</code>时出错:<code>${errorMessage}</code>。您可以尝试<a class="refresh-btn" href="">重新加载</a>或<a class="back-btn">返回</a>。</p>`,
  390. "加载失败",
  391. );
  392. waitForAnimationsEnd(
  393. document.querySelector(".markdown-body"),
  394. ".content, .old-content",
  395. ["Animation-slideInRight", "Animation-slideInLeft"],
  396. ).then(() => {
  397. customPushState(
  398. window.location.origin +
  399. window.location.pathname +
  400. (mdPath ? "?p=" + mdPath : ""),
  401. );
  402. });
  403. endLoad();
  404. }
  405. // 更新页面的 markdown 内容
  406. /*
  407. mdPath: 要加载的 markdown 文件路径,最好是带主机名的绝对路径(要用于 fetch())
  408. response: fetch() 的返回值,用于防止二次访问
  409. */
  410. const showMarkdown = async (mdPath, response = null) => {
  411. if (mdPath === null) {
  412. var path = null;
  413. const currentPath = getPath();
  414. // 如果存在 index.md 文件,则返回 index.md,否则返回 README.md
  415. if (notExistIndexPage) {
  416. path = currentPath + "README.md";
  417. } else if (notExistIndexPage === false) {
  418. path = currentPath + "index.md";
  419. } else {
  420. response = await fetch(getPath() + "index.md");
  421. if (
  422. response.ok &&
  423. response.headers.get("content-type").startsWith("text/markdown")
  424. ) {
  425. notExistIndexPage = false;
  426. path = currentPath + "index.md";
  427. } else {
  428. response = null;
  429. notExistIndexPage = true;
  430. path = currentPath + "README.md";
  431. }
  432. }
  433. } else if (mdPath.endsWith("about.md")) {
  434. // 特殊处理 about.md
  435. response = await fetch(mdPath);
  436. const about = getAbout();
  437. if (
  438. response.ok &&
  439. response.headers.get("content-type").startsWith("text/markdown")
  440. ) {
  441. var r_text = await response.text();
  442. const content = about + (await r_text.replace(/^# .*/m, ""));
  443. response = {
  444. ok: true,
  445. status: 200,
  446. statusText: "自生成。",
  447. text: async () => {
  448. return content;
  449. },
  450. };
  451. } else {
  452. response = {
  453. ok: true,
  454. status: 200,
  455. statusText: "自生成。",
  456. text: async () => {
  457. return about + "*无更多详细信息*";
  458. },
  459. };
  460. }
  461. }
  462. try {
  463. pValue = mdPath ? mdPath : path;
  464. updateContent(await getMarkdown(mdPath ? mdPath : path, response));
  465. document.querySelector("html").classList.add("loaded"); //// 防止缓存的页面被自定义 PJAX 中覆写的处理响应的函数捕获
  466. waitForAnimationsEnd(
  467. document.querySelector(".markdown-body"),
  468. ".content, .old-content",
  469. ["Animation-slideInRight", "Animation-slideInLeft"],
  470. ).then(async () => {
  471. await showMarkdownEnded();
  472. customPushState(
  473. window.location.origin +
  474. window.location.pathname +
  475. (mdPath ? "?p=" + mdPath : ""),
  476. );
  477. });
  478. } catch (error) {
  479. handleError(mdPath ? mdPath : path, error);
  480. }
  481. };
  482. // 读取并解析指定文件
  483. const getMarkdown = async (mdPath, response = null) => {
  484. //// 生成目录
  485. function generateOutline(doc) {
  486. const headings = Array.from(
  487. doc.querySelectorAll("h1, h2, h3, h4, h5, h6"),
  488. );
  489. if (headings.length === 0) return "<i>无目录</i>";
  490. var outline = "<ul>";
  491. var stack = [];
  492. headings.forEach((heading) => {
  493. const level = parseInt(heading.tagName.charAt(1));
  494. const id = heading.textContent
  495. .toLowerCase()
  496. .replace(/ /g, "-") //// 将空格替换为连字符
  497. .replace(/[^\w\u4e00-\u9fa5-]/g, ""); //// 保留字母、数字、下划线、中文字符和连字符
  498. //// 设置 id 属性以便链接跳转
  499. heading.setAttribute("id", id);
  500. while (
  501. stack.length > 0 &&
  502. stack[stack.length - 1].level >= level
  503. ) {
  504. stack.pop();
  505. outline += "</ul></li>";
  506. }
  507. if (stack.length === 0 || stack[stack.length - 1].level < level) {
  508. outline += "<li><ul>";
  509. } else {
  510. outline += "</li><li>";
  511. }
  512. outline += `<a href="#${id}">${heading.textContent}</a>`;
  513. stack.push({ level: level });
  514. });
  515. while (stack.length > 0) {
  516. outline += "</ul></li>";
  517. stack.pop();
  518. }
  519. outline += "</ul>";
  520. return outline;
  521. }
  522. if (!response) {
  523. response = await fetch(mdPath);
  524. if (
  525. !response.ok &&
  526. response.headers.get("content-type").startsWith("text/markdown")
  527. ) {
  528. throw new Error(
  529. "请求失败:" +
  530. mdPath +
  531. "," +
  532. response.headers.get("content-type") +
  533. "," +
  534. response.status +
  535. "," +
  536. response.statusText,
  537. );
  538. }
  539. }
  540. var markdown_content = await response.text();
  541. var content = marked.parse(markdown_content);
  542. //// 因为是在本页面渲染一个其它页面的文档:
  543. //// - 从 content 中获取所有 href 以 .md 结尾的 a 标签;
  544. //// - 遍历这些 a 标签,如果 href 不是外链,则判断 href 是否为相对路径……最后转换为 ?p=<到该文件的绝对路径>
  545. //// - 从 content 中获取所有 img 标签;
  546. //// - 遍历这些 img 标签,如果 src 不是外链,则判断 src 是否为相对路径……最后转换为 <到该文件的绝对路径>
  547. const linkParser = new DOMParser();
  548. const linkDoc = linkParser.parseFromString(
  549. `<div>${content}</div>`,
  550. "text/html",
  551. );
  552. //// 处理所有 a 链接
  553. const mdLinks = linkDoc.querySelectorAll('a[href]:not([href=""])');
  554. mdLinks.forEach((link) => {
  555. const href = link.getAttribute("href");
  556. if (!isExternalLink(href) && isRelativePath(href)) {
  557. var absolutePath = pValue
  558. ? getDirectory(mdPath) + href
  559. : getPath() + href;
  560. absolutePath = new URL(absolutePath, "http://example.com")
  561. .pathname;
  562. if (absolutePath.endsWith(".md")) {
  563. link.setAttribute("href", `?p=${absolutePath}`);
  564. } else {
  565. link.setAttribute("href", absolutePath);
  566. }
  567. }
  568. });
  569. //// 处理所有图片
  570. const images = linkDoc.querySelectorAll("img");
  571. images.forEach((img) => {
  572. const src = img.getAttribute("src");
  573. img.setAttribute("loading", "lazy");
  574. if (
  575. src &&
  576. !src.startsWith("data:") &&
  577. !isExternalLink(src) &&
  578. isRelativePath(src)
  579. ) {
  580. var absolutePath = pValue
  581. ? getDirectory(mdPath) + src
  582. : getPath() + src;
  583. absolutePath = new URL(absolutePath, "http://example.com")
  584. .pathname;
  585. img.setAttribute("src", absolutePath);
  586. }
  587. });
  588. //// 更新处理后的 markdown 内容
  589. content = linkDoc.body.innerHTML.replace(/^<div>|<\/div>$/g, "");
  590. //// 空文件
  591. if (content === "") {
  592. content = "<i>空文件</i>";
  593. }
  594. //// 添加目录
  595. content = `<details class="outline"><summary>${decodeURIComponent(
  596. mdPath,
  597. )}</summary></details><hr>${content}`;
  598. const parser = new DOMParser();
  599. const doc = parser.parseFromString(content, "text/html");
  600. const outline = generateOutline(doc);
  601. doc.querySelector(".outline").innerHTML += outline;
  602. return doc.body.innerHTML;
  603. };
  604. // 初始化自定义 PJAX 响应
  605. function initCustomPJAXResponse() {
  606. //// 覆写 PJAX 处理响应的函数,在内容插入页面之前实现 markdown 的渲染
  607. PJAX._handleResponse = PJAX.handleResponse;
  608. PJAX.handleResponse = async function (
  609. responseText,
  610. request,
  611. href,
  612. options,
  613. ) {
  614. if (
  615. /^<!doctype html>[\s\S]*?<html>[\s\S]*?<markdown-html/i.test(
  616. request.responseText,
  617. )
  618. ) {
  619. await showMarkdown(await decodeMDPath(href));
  620. } else {
  621. PJAX._handleResponse(responseText, request, href, options);
  622. }
  623. };
  624. }
  625. // 初始化自定义 PJAX 事件监听器
  626. function initCustomPJAXEventListener() {
  627. // 监听自定义链接的点击事件
  628. if (existPushState) {
  629. document
  630. .querySelector(".markdown-body")
  631. .addEventListener("click", async function (event) {
  632. const link = event.target.closest('a[href$=".md"]');
  633. if (link) {
  634. try {
  635. event.preventDefault();
  636. startLoad();
  637. await showMarkdown(await decodeMDPath(link.href));
  638. } catch (e) {
  639. console.error("自定义 PJAX 出错:" + e);
  640. }
  641. }
  642. });
  643. }
  644. }
  645. // 自定义推送状态
  646. function customPushState(url = window.location.href) {
  647. if (existPushState) {
  648. if (level > lastLevel) {
  649. history.pushState(
  650. { url: url, title: document.title, uid: level },
  651. null,
  652. url,
  653. );
  654. lastLevel = level++;
  655. } else {
  656. lastLevel = level - 1;
  657. }
  658. }
  659. }
  660. // 初始化内容
  661. const initContent = async () => {
  662. try {
  663. await showMarkdown(await getPValue());
  664. } catch (error) {
  665. handleError(await getPValue(), "初始化内容时出错:" + error);
  666. }
  667. };
  668. // 初始化返回首页按钮
  669. function initHomeBtn() {
  670. const homeBtn = document.querySelector(".to-home");
  671. homeBtn.href = window.location.pathname;
  672. }
  673. // 初始化返回首页按钮
  674. function initAboutBtn() {
  675. const aboutBtn = document.querySelector(".about-btn");
  676. aboutBtn.href = `?p=${getDirectory(
  677. window.location.pathname,
  678. )}about.md`;
  679. }
  680. // 初始化
  681. function initialize() {
  682. startLoad(); //// 开始加载动画
  683. initDarkmode(); //// 初始化深色模式
  684. initHomeBtn(); //// 初始化返回首页按钮
  685. initAboutBtn(); //// 初始化关于按钮
  686. initContent(); //// 初始化内容
  687. initTranslate(); //// 初始化页面翻译
  688. initPJAX(); //// 初始化 PJAX
  689. initCustomPJAXResponse(); //// 初始化自定义 PJAX 响应
  690. initCustomPJAXEventListener(); //// 初始化自定义 PJAX 事件监听器
  691. // loadCSS(
  692. // "https://chinese-fonts-cdn.deno.dev/packages/maple-mono-cn/dist/MapleMono-CN-Regular/result.css"
  693. // ); //// 加载字体 CSS,会造成渲染阻塞,暂时禁用
  694. endLoad(); //// 结束加载动画
  695. }
  696. // 触发器
  697. //// 网页加载完毕后触发初始化
  698. window.addEventListener("DOMContentLoaded", () => initialize());
  699. //// 翻译执行完成后触发
  700. translate.listener.renderTaskFinish = function (_task) {
  701. endLoad();
  702. };
  703. //// PJAX 开始时执行的函数
  704. document.addEventListener("pjax:send", function () {
  705. startLoad();
  706. });
  707. //// 监听 PJAX 完成后,重新加载
  708. document.addEventListener("pjax:complete", async function () {
  709. await showMarkdown(await getPValue());
  710. initCustomPJAXEventListener(); //// 重新初始化自定义 PJAX 事件监听器
  711. });
  712. //// 监听 animationend 事件
  713. document.addEventListener(
  714. "animationend",
  715. function handleAnimationEnd(event) {
  716. if (event.animationName === "Animation-slideInRight") {
  717. const element = document.querySelector(".markdown-body .content");
  718. element.classList.remove("Animated");
  719. element.classList.remove("Animate--slideInRight");
  720. } else if (event.animationName === "Animation-slideInLeft") {
  721. document.querySelector(".markdown-body .old-content").remove();
  722. }
  723. },
  724. );
  725. //// 点击事件委托
  726. document.addEventListener("click", function (event) {
  727. const imgOrSvg = event.target.closest(".content img, .content svg");
  728. if (imgOrSvg) {
  729. const url =
  730. imgOrSvg.getAttribute("src") ||
  731. imgOrSvg.getAttribute("xlink:href");
  732. if (url) {
  733. window.open(url, "_blank");
  734. event.preventDefault();
  735. } else {
  736. const newWindow = window.open("", "_blank");
  737. newWindow.document.write(imgOrSvg.outerHTML);
  738. newWindow.document.close();
  739. event.preventDefault();
  740. }
  741. return;
  742. }
  743. if (event.target.closest(".back-btn")) {
  744. window.history.back();
  745. } else if (event.target.closest(".refresh-btn")) {
  746. window.location.reload();
  747. } else if (event.target.closest(".dark-btn")) {
  748. darkmode.toggle();
  749. } else if (event.target.closest(".translate-switch")) {
  750. translate.changeLanguage(translate.language.getLocal());
  751. /* 跳转。禁用原因是有些带有特殊字符的链接会出错或无法跳转
  752. } else if (event.target.closest('.content a[href^="#"]')) {
  753. // 目录平滑移动
  754. const href = event.target.getAttribute('href');
  755. if (href !== '#') {
  756. event.preventDefault();
  757. const targetElement = document.querySelector(href);
  758. if (targetElement) {
  759. targetElement.scrollIntoView({
  760. behavior: 'smooth'
  761. });
  762. } else {
  763. console.error(`ID 为 ${targetId} 的元素不存在。`);
  764. }
  765. }
  766. */
  767. } else if (event.target.closest('.content a[href]:not([href=""])')) {
  768. const href = event.target.getAttribute("href");
  769. if (isExternalLink(href)) {
  770. window.open(href, "_blank");
  771. event.preventDefault();
  772. }
  773. } else if (event.target.closest(".content img, .content svg")) {
  774. const url =
  775. event.target.getAttribute("src") ||
  776. event.target.getAttribute("xlink:href");
  777. if (url) {
  778. window.open(url, "_blank");
  779. event.preventDefault();
  780. } else {
  781. const newWindow = window.open("", "_blank");
  782. newWindow.document.write(imgOrSvg.outerHTML);
  783. newWindow.document.close();
  784. event.preventDefault();
  785. }
  786. }
  787. });
  788. //// 文档内容加载完毕时触发
  789. async function showMarkdownEnded() {
  790. refreshTranslate();
  791. infoTranslate(); //// 检查并提示翻译
  792. await mermaid.init({ noteMargin: 10 }, ".language-mermaid"); //// 初始化 mermaid
  793. translate.execute(); //// 手动触发翻译,但是理论上 translate-js 会监听页面变化
  794. hljs.highlightAll(); //// 触发代码块语法高亮
  795. endLoad();
  796. window.scrollTo({
  797. top: 0,
  798. behavior: "smooth",
  799. });
  800. }
  801. //// 浏览器返回时触发
  802. window.onpopstate = function (event) {
  803. if (level > 1) {
  804. --level;
  805. }
  806. };
  807. })();
  808. </script>
  809. <title>加载中</title>
  810. <style>
  811. /* 全局 */
  812. :root,
  813. html,
  814. body,
  815. button,
  816. input,
  817. select,
  818. textarea,
  819. code,
  820. pre {
  821. font-family:
  822. "Sarasa Term SC Nerd", "Maple Mono CN", Ubuntu, Roboto, "Open Sans",
  823. "Microsoft YaHei", Arial, sans-serif;
  824. text-decoration: none;
  825. }
  826. :root,
  827. html,
  828. body {
  829. background-color: #e6e6e6;
  830. }
  831. ::selection {
  832. background-color: #dcedc8;
  833. }
  834. body {
  835. margin: 0;
  836. }
  837. a {
  838. color: #66bb6a;
  839. cursor: pointer;
  840. text-decoration: none;
  841. }
  842. a:hover {
  843. color: #2e7d32;
  844. }
  845. /* 背景 */
  846. .background {
  847. position: fixed;
  848. left: 0;
  849. top: 0;
  850. height: 100%;
  851. width: 100%;
  852. z-index: -1;
  853. background-color: #e6e6e6;
  854. }
  855. /* 导航栏 */
  856. nav {
  857. position: fixed;
  858. top: 0;
  859. right: 0;
  860. width: min-content;
  861. background-color: #616161;
  862. display: flex;
  863. justify-content: space-between;
  864. align-items: center;
  865. z-index: 1;
  866. }
  867. nav a {
  868. color: #fafafa;
  869. padding: 0.3rem;
  870. transition:
  871. color 0.2s,
  872. background-color 0.2s;
  873. }
  874. nav a:hover {
  875. color: #fff;
  876. background-color: #212121;
  877. }
  878. /* 动画 */
  879. .Animated {
  880. animation-fill-mode: both;
  881. animation-duration: 1s;
  882. }
  883. .Animated-remove {
  884. position: absolute;
  885. }
  886. .Animated--reverse {
  887. animation-direction: reverse;
  888. }
  889. .Animate--fast {
  890. animation-duration: 0.5s;
  891. }
  892. .Animate--noDelay {
  893. animation-delay: 0s !important;
  894. }
  895. .Animate--slideInRight {
  896. animation-name: Animation-slideInRight;
  897. }
  898. @keyframes Animation-slideInRight {
  899. 0% {
  900. transform: translateX(200%);
  901. }
  902. 100% {
  903. transform: translateX(0);
  904. }
  905. }
  906. .Animate--slideInLeft {
  907. animation-name: Animation-slideInLeft;
  908. }
  909. @keyframes Animation-slideInLeft {
  910. 0% {
  911. transform: translateX(-100%);
  912. }
  913. 100% {
  914. transform: translateX(0);
  915. }
  916. }
  917. /* 主要内容 */
  918. .markdown-body {
  919. position: relative;
  920. margin: 3rem auto;
  921. width: 100%;
  922. max-width: 950px;
  923. min-height: 300px;
  924. background-color: #fafafa;
  925. color: #212121;
  926. box-sizing: border-box;
  927. overflow-x: hidden;
  928. box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
  929. }
  930. .markdown-body .content,
  931. .markdown-body .old-content {
  932. margin: 2rem;
  933. }
  934. .markdown-body img,
  935. .markdown-body video,
  936. .markdown-body iframe,
  937. .markdown-body object,
  938. .markdown-body embed,
  939. .markdown-body svg,
  940. .markdown-body canvas,
  941. .markdown-body audio {
  942. max-width: 100%;
  943. background-color: rgba(0, 0, 0, 0.05);
  944. }
  945. /* Markdown 样式 */
  946. .markdown-body a {
  947. transition:
  948. color 0.2s,
  949. background-color 0.2s;
  950. }
  951. .markdown-body a:hover {
  952. background-color: rgba(255, 255, 255, 0.1);
  953. }
  954. .markdown-body ul,
  955. .markdown-body ol {
  956. padding-left: 2rem;
  957. }
  958. .markdown-body pre {
  959. background-color: rgba(0, 0, 0, 0.05);
  960. padding: 0.4rem;
  961. border-radius: 0.1rem;
  962. overflow-y: scroll;
  963. }
  964. .markdown-body code {
  965. font-family: "cousine nerd font mono", monospace;
  966. background-color: rgba(0, 0, 0, 0.05);
  967. font-size: small;
  968. padding: 0.2rem;
  969. border-radius: 0.1rem;
  970. }
  971. .markdown-body pre code {
  972. background-color: unset;
  973. font-size: unset;
  974. padding: unset;
  975. border-radius: unset;
  976. }
  977. .markdown-body blockquote {
  978. background-color: rgba(0, 0, 0, 0.05);
  979. font-size: small;
  980. padding: 0.4rem;
  981. margin: 0.5rem 2rem;
  982. border-left: 5px solid rgba(0, 0, 0, 0.1);
  983. }
  984. .markdown-body details {
  985. border: 1px solid rgba(0, 0, 0, 0.1);
  986. border-radius: 0.1rem;
  987. }
  988. .markdown-body summary {
  989. font-size: small;
  990. cursor: pointer;
  991. background-color: rgba(0, 0, 0, 0.05);
  992. padding: 0.4rem;
  993. font-weight: bold;
  994. }
  995. .markdown-body details a {
  996. margin-left: -2rem;
  997. }
  998. .markdown-body table {
  999. border-spacing: 0;
  1000. border-radius: 0.1rem;
  1001. width: 100%;
  1002. border-collapse: separate;
  1003. border: 0.1rem solid rgba(0, 0, 0, 0.05);
  1004. }
  1005. .markdown-body table > * {
  1006. overflow-y: scroll;
  1007. }
  1008. .markdown-body table td,
  1009. .markdown-body table th {
  1010. border-right: 0.1rem solid rgba(0, 0, 0, 0.05);
  1011. border-top: 0.1rem solid rgba(0, 0, 0, 0.05);
  1012. padding: 0.4rem;
  1013. }
  1014. .markdown-body table td:last-child,
  1015. .markdown-body th:last-child {
  1016. border-right-color: transparent;
  1017. }
  1018. .markdown-body table thead tr:first-child > * {
  1019. border-top: 0.1rem solid transparent;
  1020. }
  1021. /* 加载进度条 */
  1022. .loading-bar {
  1023. position: fixed;
  1024. top: 0;
  1025. left: 0;
  1026. z-index: 2;
  1027. opacity: 0;
  1028. transition: opacity 0.4s linear;
  1029. .progress {
  1030. position: fixed;
  1031. top: 0;
  1032. left: 0;
  1033. width: 0;
  1034. height: 4px;
  1035. background-color: #2e7d32;
  1036. box-shadow: 0 0 10px rgba(102, 187, 106, 0.7);
  1037. }
  1038. &.loading {
  1039. opacity: 1;
  1040. transition: none;
  1041. .progress {
  1042. transition: width 0.4s ease;
  1043. }
  1044. }
  1045. }
  1046. /* 翻译按钮相关 */
  1047. .translateSelectLanguage {
  1048. background-color: #616161;
  1049. color: inherit;
  1050. z-index: 3;
  1051. width: 17%;
  1052. height: 100%;
  1053. opacity: 0;
  1054. cursor: pointer;
  1055. position: absolute;
  1056. top: 0;
  1057. left: 50%;
  1058. }
  1059. /* 深色模式相关 */
  1060. /* 防止背景图片、svg、canvas 和视频等混色 */
  1061. .darkmode--activated .markdown-body img,
  1062. .darkmode--activated .markdown-body svg,
  1063. .darkmode--activated .markdown-body canvas,
  1064. .darkmode--activated .markdown-body video {
  1065. isolation: isolate;
  1066. mix-blend-mode: difference;
  1067. }
  1068. .darkmode-layer,
  1069. .darkmode-toggle {
  1070. z-index: 3;
  1071. }
  1072. /* 小屏响应式优化 */
  1073. @media only screen and (max-width: 950px) {
  1074. :root,
  1075. html,
  1076. body {
  1077. background-color: #616161;
  1078. }
  1079. :root,
  1080. html,
  1081. body,
  1082. .markdown-body {
  1083. height: 100%;
  1084. }
  1085. nav {
  1086. position: relative;
  1087. margin-left: auto;
  1088. }
  1089. .markdown-body {
  1090. overflow-y: scroll;
  1091. min-width: 256px;
  1092. top: 0;
  1093. margin: 0 0;
  1094. }
  1095. }
  1096. </style>
  1097. <link
  1098. href="https://lib.baomitu.com/highlight.js/11.4.0/styles/default.min.css"
  1099. type="text/css"
  1100. rel="stylesheet"
  1101. />
  1102. </head>
  1103. <body>
  1104. <!-- 导航栏 -->
  1105. <nav>
  1106. <a title="返回" class="back-btn">
  1107. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1108. <svg
  1109. xmlns="http://www.w3.org/2000/svg"
  1110. width="24"
  1111. height="24"
  1112. viewBox="0 0 24 24"
  1113. fill="none"
  1114. stroke="currentColor"
  1115. stroke-width="2"
  1116. stroke-linecap="round"
  1117. stroke-linejoin="round"
  1118. class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-back"
  1119. >
  1120. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1121. <path d="M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1" />
  1122. </svg>
  1123. </a>
  1124. <a title="刷新" class="refresh-btn" href="">
  1125. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1126. <svg
  1127. xmlns="http://www.w3.org/2000/svg"
  1128. width="24"
  1129. height="24"
  1130. viewBox="0 0 24 24"
  1131. fill="none"
  1132. stroke="currentColor"
  1133. stroke-width="2"
  1134. stroke-linecap="round"
  1135. stroke-linejoin="round"
  1136. class="icon icon-tabler icons-tabler-outline icon-tabler-refresh"
  1137. >
  1138. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1139. <path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" />
  1140. <path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" />
  1141. </svg>
  1142. </a>
  1143. <a title="主页" class="to-home">
  1144. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1145. <svg
  1146. xmlns="http://www.w3.org/2000/svg"
  1147. width="24"
  1148. height="24"
  1149. viewBox="0 0 24 24"
  1150. fill="none"
  1151. stroke="currentColor"
  1152. stroke-width="2"
  1153. stroke-linecap="round"
  1154. stroke-linejoin="round"
  1155. class="icon icon-tabler icons-tabler-outline icon-tabler-home"
  1156. >
  1157. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1158. <path d="M5 12l-2 0l9 -9l9 9l-2 0" />
  1159. <path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7" />
  1160. <path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6" />
  1161. </svg>
  1162. </a>
  1163. <a title="更改语言" id="translate">
  1164. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1165. <svg
  1166. xmlns="http://www.w3.org/2000/svg"
  1167. width="24"
  1168. height="24"
  1169. viewBox="0 0 24 24"
  1170. fill="none"
  1171. stroke="currentColor"
  1172. stroke-width="2"
  1173. stroke-linecap="round"
  1174. stroke-linejoin="round"
  1175. class="icon icon-tabler icons-tabler-outline icon-tabler-language"
  1176. >
  1177. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1178. <path d="M4 5h7" />
  1179. <path d="M9 3v2c0 4.418 -2.239 8 -5 8" />
  1180. <path d="M5 9c0 2.144 2.952 3.908 6.7 4" />
  1181. <path d="M12 20l4 -9l4 9" />
  1182. <path d="M19.1 18h-6.2" />
  1183. </svg>
  1184. </a>
  1185. <a title="切换显示模式" class="dark-btn" href="javascript:;">
  1186. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1187. <svg
  1188. xmlns="http://www.w3.org/2000/svg"
  1189. width="24"
  1190. height="24"
  1191. viewBox="0 0 24 24"
  1192. fill="none"
  1193. stroke="currentColor"
  1194. stroke-width="2"
  1195. stroke-linecap="round"
  1196. stroke-linejoin="round"
  1197. class="icon icon-tabler icons-tabler-outline icon-tabler-brightness"
  1198. >
  1199. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1200. <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
  1201. <path d="M12 3l0 18" />
  1202. <path d="M12 9l4.65 -4.65" />
  1203. <path d="M12 14.3l7.37 -7.37" />
  1204. <path d="M12 19.6l8.85 -8.85" />
  1205. </svg>
  1206. </a>
  1207. <a title="关于" class="about-btn">
  1208. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1209. <svg
  1210. xmlns="http://www.w3.org/2000/svg"
  1211. width="24"
  1212. height="24"
  1213. viewBox="0 0 24 24"
  1214. fill="none"
  1215. stroke="currentColor"
  1216. stroke-width="2"
  1217. stroke-linecap="round"
  1218. stroke-linejoin="round"
  1219. class="icon icon-tabler icons-tabler-outline icon-tabler-info-circle"
  1220. >
  1221. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1222. <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
  1223. <path d="M12 9h.01" />
  1224. <path d="M11 12h1v4h1" />
  1225. </svg>
  1226. </a>
  1227. </nav>
  1228. <!-- 内容主体 -->
  1229. <div class="markdown-body">
  1230. <div class="content">
  1231. <h1>加载中……</h1>
  1232. <p>请稍等。</p>
  1233. </div>
  1234. </div>
  1235. <!-- 加载动画 -->
  1236. <div class="loading-bar">
  1237. <div class="progress"></div>
  1238. </div>
  1239. <div class="background"></div>
  1240. <script
  1241. src="https://lib.baomitu.com/instant.page/5.1.0/instantpage.min.js"
  1242. type="text/javascript"
  1243. ></script>
  1244. </body>
  1245. </html>