-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathset_profile.sh
More file actions
executable file
·43 lines (41 loc) · 1.07 KB
/
set_profile.sh
File metadata and controls
executable file
·43 lines (41 loc) · 1.07 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
profile=$(cat profile.conf)
origin_profile="clientID: 'GitHub Application Client ID',
clientSecret: 'GitHub Application Client Secret',
repo: 'GitHub repo',
owner: 'GitHub repo owner',
admin: [
'GitHub repo owner and collaborators, only these guys can initialize github issues'
],
createIssueManually: true,
id: document.title"
if [ "$profile" = "$origin_profile" ]
then
echo "Error: Please change porfile.conf !!!"
else
cat > gitbook/comment.html << EOF
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css"
/>
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<div id="gitalk-container" style="margin: 5%"></div>
<script>
const gitalk = new Gitalk({
${profile}
})
gitalk.render('gitalk-container')
</script>
<script>
require(['gitbook'], function(gitbook) {
const gitalk = new Gitalk({
${profile}
})
gitbook.events.bind('page.change', initMygitalk)
function initMygitalk() {
gitalk.render('gitalk-container')
}
})
</script>
EOF
echo "Done! run `gitbook serve` to preview your web doc"
fi