index.html 44 KB

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