-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (45 loc) · 1.78 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<title>捕蛇者说 Ask me anything</title>
</head>
<body>
<div id="container"></div>
</body>
</html>
<script src="https://pythonhunters.github.io/gitmint/gitmint.browser.js"></script>
<link rel="stylesheet" href="https://aimingoo.github.io/gitmint/style/default.css">
<script type="text/javascript">
const myTheme = {
render(state, instance) {
const container = document.createElement('div')
container.lang = "zh-CN"
container.className = 'gitment-container gitment-root-container'
// your custom component
container.appendChild(instance.renderTitle(state, instance))
container.appendChild(instance.renderEditor(state, instance))
container.appendChild(instance.renderComments(state, instance))
container.appendChild(instance.renderFooter(state, instance))
return container
},
renderTitle(state, instance) {
const container = document.createElement('div')
container.style.cssText = "font-size: 24px";
container.innerHTML = "欢迎大家来到捕蛇者说 ask me anything<br>你可以提出任何想问的问题,并对已有的提问投票。<br>";
container.innerHTML += "也可以直接访问 <a target='_blank' href='https://github.com/pythonhunters/AMA/issues/1'>issue page</a><br><br>"
container.innerHTML += "我们会在x月x号录一期节目回答这些问题,其中高票问题会优先被回答。<br>";
return container
}
}
const gitment = new Gitmint({
owner: 'pythonhunters',
repo: 'AMA',
admin: ['adamwen', 'laike9m', 'laixintao', 'Zheaoli'],
oauth: {
client_id: '8451b12fd6eb23e265d0',
client_secret: '2f70ba72eea4fdd39d2fb43fa4f05fb03a3e6488',
},
theme: myTheme,
});
gitment.render('container');
</script>