-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
53 lines (51 loc) · 1.77 KB
/
index.html
File metadata and controls
53 lines (51 loc) · 1.77 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" id="dynamic-favicon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title id="dynamic-title">deepwn.github.io</title>
<script>
// Get favicon MIME type based on file extension
function getFaviconMimeType(url) {
const extension = url.split('.').pop()?.toLowerCase();
const mimeTypes = {
svg: 'image/svg+xml',
png: 'image/png',
ico: 'image/x-icon',
jpg: 'image/jpeg',
jpeg: 'image/jpeg',
gif: 'image/gif',
webp: 'image/webp',
};
return mimeTypes[extension] || 'image/x-icon';
}
// Fetch config and update page title and favicon
fetch('/config.json')
.then(r => r.json())
.then(config => {
// Support both flat structure (config.website) and nested structure (config.site.website)
const websiteConfig = config.website || config.site?.website;
if (websiteConfig) {
if (websiteConfig.title) {
document.title = websiteConfig.title;
}
if (websiteConfig.favicon) {
const faviconLink = document.getElementById('dynamic-favicon');
if (faviconLink) {
faviconLink.setAttribute('href', websiteConfig.favicon);
faviconLink.setAttribute('type', getFaviconMimeType(websiteConfig.favicon));
}
}
}
})
.catch(() => {
// Silently fail - keep default values
});
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>