forked from prakis/stringify.me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
36 lines (29 loc) · 916 Bytes
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Stringify.me</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.3.0/mustache.min.js"></script>
</head>
<body onload="onLoad()">
<div id="maindiv"></div>
<script>
function onLoad(){
fetch('profile.json')
.then((resp) => resp.json())
.then(function(profilejson) {
const templateurl = profilejson.theme.url.replace("github.com", "raw.githubusercontent.com") + "/master/template.html";
fetch(templateurl)
.then((resp) => resp.text())
.then(function(template) {
document.title = profilejson.basics.name;
profilejson.basics.picture_fullpath = profilejson.basics.picture;
var __html = Mustache.render(template, profilejson);
document.getElementById("maindiv").innerHTML = __html;
});
});
}
</script>
</body>
</html>