31 lines
975 B
Plaintext
31 lines
975 B
Plaintext
<script>
|
|
window.yiliaConfig = {
|
|
isHome: <%=is_home()%>,
|
|
isPost: <%=is_post()%>,
|
|
isArchive: <%=is_archive()%>,
|
|
isTag: <%=is_tag()%>,
|
|
isCategory: <%=is_category()%>,
|
|
open_in_new: <%=theme.open_in_new%>,
|
|
toc_hide_index: <%=theme.toc_hide_index%>,
|
|
root: "<%=config.root%>",
|
|
showTags: <%=(theme.slider && theme.slider.showTags) ? true : false%>
|
|
}
|
|
</script>
|
|
<%- partial('script') %>
|
|
<% if(theme.gitalk.enable && is_post()) { %>
|
|
<link rel="stylesheet" type="text/css" href="https://unpkg.com/gitalk/dist/gitalk.css">
|
|
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
|
<script>
|
|
(function(Gitalk){
|
|
new Gitalk({
|
|
clientID: '<%=theme.gitalk.ClientID%>',
|
|
clientSecret: '<%=theme.gitalk.ClientSecret%>',
|
|
repo: '<%=theme.gitalk.repo%>',
|
|
owner: '<%=theme.gitalk.githubID%>',
|
|
admin: ['<%=theme.gitalk.adminUser%>'],
|
|
id: decodeURI(location.pathname),
|
|
distractionFreeMode: <%=theme.gitalk.distractionFreeMode%>
|
|
}).render('comments')
|
|
})(Gitalk)
|
|
</script>
|
|
<% } %> |