-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwiki.html
More file actions
67 lines (55 loc) · 2.68 KB
/
wiki.html
File metadata and controls
67 lines (55 loc) · 2.68 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
<!DOCTYPE html>
<html lang="nl">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="description" content="Wigo4it Duurzaamheidsradar: De radar voor duurzaam bewustzijn.">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<meta charset="UTF-8">
<title>Wigo4it Tech</title>
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="/icons/site.webmanifest">
<link rel="mask-icon" href="/icons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="stylesheet" href="wiki.css">
</head>
<body>
<div id="wiki-container"></div>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
const params = new URLSearchParams(window.location.search);
const wikiKey = params.get('page');
if (wikiKey) {
const wikiPath = `wiki/${wikiKey}.md`;
fetch(wikiPath)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then(markdown => {
// Extract the first line of the markdown file
const firstLine = markdown.split('\n')[0];
// Remove '#' and the space, then set as the document's title
const pageTitle = firstLine.replace('# ', '');
document.title = "Tech Radar - " + pageTitle;
// Parse the markdown to HTML and display it
const htmlContent = marked.parse(markdown);
document.getElementById('wiki-container').innerHTML = htmlContent;
})
.catch(error => {
console.error('Error fetching the markdown file:', error);
document.getElementById('wiki-container').innerHTML = 'Wiki-item niet gevonden.';
});
} else {
document.getElementById('wiki-container').innerHTML = 'Geen wiki-item opgegeven.';
}
});
</script>
</body>
</html>