File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<!doctype html>
22
33< html >
4- < markdown-html version ="1.12 .0 " author ="PJ568 " repo ="https://github.com/PJ-568/markdown.html "
4+ < markdown-html version ="1.13 .0 " author ="PJ568 " repo ="https://github.com/PJ-568/markdown.html "
55 license ="CC BY-SA 4.0 International "> </ markdown-html >
66
77< head >
2323 < script >
2424 // 使用 IIFE 包裹以避免全局变量污染
2525 ( function ( ) {
26- const about = `
26+ function getVersion ( ) {
27+ const markdownElement = document . querySelector ( 'markdown-html' ) ;
28+ if ( markdownElement ) {
29+ const version = markdownElement . getAttribute ( 'version' ) ;
30+ return version ;
31+ } else {
32+ return '未知' ;
33+ }
34+ }
35+
36+ function getAbout ( ) {
37+ return `
2738# 关于
2839
2940## MARKDOWN.HTML
3041
42+ 版本:${ getVersion ( ) }
43+
3144旨在提供低依赖、一键部署的 Markdown 网页渲染方案。
3245
46+ ### 特性
47+
48+ - **依赖少**:仅需一个 HTML 文件、少量 CDN 和服务器程序,即可完成 Markdown 网页渲染。
49+ - **Markdown 支持**:将 Markdown 文件渲染为 HTML。
50+ - **Mermaid 支持**:将 Markdown 中的 Mermaid 语法渲染为图表。
51+ - **多语言支持**:支持多种语言间的机器互译。
52+ - **深色模式**:支持浅色、深色、跟随系统。
53+ - **Pjax 支持**:支持无刷新页面跳转。
54+
3355详情请访问 [GitHub](https://github.com/PJ-568/MARKDOWN.HTML) 或 [Gitee](https://gitee.com/PJ-568/MARKDOWN.HTML) 仓库。
3456
3557` ;
58+ }
3659
3760 // 加载动画相关
3861 var loadingState = {
333356 } else if ( mdPath . endsWith ( 'about.md' ) ) {
334357 // 特殊处理 about.md
335358 response = await fetch ( mdPath ) ;
359+ const about = getAbout ( ) ;
336360 if ( response . ok && response . headers . get ( 'content-type' ) . startsWith ( 'text/markdown' ) ) {
337361 var r_text = await response . text ( ) ;
338362 const content = about + await r_text . replace ( / ^ # .* / m, '' ) ;
You can’t perform that action at this time.
0 commit comments