forked from Snailclimb/JavaGuide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·99 lines (89 loc) · 3.72 KB
/
index.html
File metadata and controls
executable file
·99 lines (89 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>JavaGuide</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<!--主题-->
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" />
</head>
<body>
<div id="app"></div>
<!-- docsify-edit-on-github (需要放在 docsify 脚本之前,因为它修改的是 $docsify 配置) -->
<script src="//unpkg.com/docsify-edit-on-github/index.js"></script>
<script>
// 离线支持
if (typeof navigator.serviceWorker !== "undefined") {
navigator.serviceWorker.register("sw.js");
}
window.$docsify = {
name: "JavaGuide",
repo: "https://github.com/Snailclimb/JavaGuide",
maxLevel: 4, //最大支持渲染的标题层级
//封面,_coverpage.md
//coverpage: true,
auto2top: true, //切换页面后是否自动跳转到页面顶部
//ga: 'UA-138586553-1',
//logo: 'https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-3logo-透明.png' ,
search: {
//maxAge: 86400000, // 过期时间,单位毫秒,默认一天
paths: "auto",
placeholder: "搜索",
noData: "找不到结果",
// 搜索标题的最大程级, 1 - 6
depth: 3,
},
// 字数统计
count: {
countable: true,
fontsize: "0.9em",
color: "rgb(90,90,90)",
language: "chinese",
},
// =========== Plugins Configuration ===========
plugins: [
// --- New Plugin to Add referrerpolicy="no-referrer" to ALL Images ---
function (hook) {
hook.afterEach(function (html, next) {
// Regex to find all img tags globally and case-insensitively
const imgTagRegex = /<img[^>]*>/gi;
let modifiedHtml = html.replace(imgTagRegex, function(match) {
// Check if referrerpolicy attribute is already present (case-insensitive)
if (match.toLowerCase().includes('referrerpolicy=')) {
return match; // Attribute already exists, return original match
}
// Add the attribute right before the closing '>'
// This replaces the last '>' with the attribute and '>'
return match.replace(/>$/, ' referrerpolicy="no-referrer">');
});
next(modifiedHtml);
});
}
// --- End New Plugin ---
],
// ===========================================
};
</script>
<!-- Main Docsify script (必须在配置脚本之后) -->
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<!-- 其他 Docsify 插件 (通常在主 docsify 脚本之后) -->
<!--Java代码高亮-->
<script src="//unpkg.com/prismjs/components/prism-java.js"></script>
<!--全文搜索,直接用官方提供的无法生效-->
<script src="https://cdn.bootcss.com/docsify/4.5.9/plugins/search.min.js"></script>
-->
<!-- 复制到剪贴板 -->
<script src="//unpkg.com/docsify-copy-code"></script>
<!-- 图片缩放 -->
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.js"></script>
<!-- 表情 -->
<script src="//unpkg.com/docsify/lib/plugins/emoji.js"></script>
<!-- 字数统计 -->
<script src="//unpkg.com/docsify-count/dist/countable.js"></script>
</body>
</html>