-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
46 lines (42 loc) · 1.7 KB
/
index.html
File metadata and controls
46 lines (42 loc) · 1.7 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
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<!-- 动态favicon将由React组件管理 -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Google Fonts - Roboto -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet"
/>
<meta name="author" content="Repo-Viewer" />
<title>Repo-Viewer</title>
<script type="module">
const env = import.meta.env;
const defaultTitle = "Repo-Viewer";
const defaultDesc = "基于MD3设计语言的GitHub仓库浏览应用";
const defaultKeywords = "GitHub, 仓库, 浏览器, 代码, 查看器";
const title = env.VITE_SITE_TITLE || env.SITE_TITLE || defaultTitle;
const description = env.VITE_SITE_DESCRIPTION || env.SITE_DESCRIPTION || defaultDesc;
const keywords = env.VITE_SITE_KEYWORDS || env.SITE_KEYWORDS || defaultKeywords;
document.title = title;
const ensureMeta = (name, content) => {
let el = document.querySelector(`meta[name=\"${name}\"]`);
if (!el) {
el = document.createElement("meta");
el.setAttribute("name", name);
document.head.appendChild(el);
}
el.setAttribute("content", content);
};
ensureMeta("description", description);
ensureMeta("keywords", keywords);
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>