Initial website
This commit is contained in:
43
themes/hueman/layout/comment/changyan.ejs
Normal file
43
themes/hueman/layout/comment/changyan.ejs
Normal file
@@ -0,0 +1,43 @@
|
||||
<% if (typeof(script) !== 'undefined' && script) { %>
|
||||
<script id="cy_cmt_num" src="https://changyan.sohu.com/upload/plugins/plugins.list.count.js?clientId=<%= theme.comment.changyan.appId %>"></script>
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var appid = '<%= theme.comment.changyan.appId %>';
|
||||
var conf = '<%= theme.comment.changyan.appKey %>';
|
||||
var width = window.innerWidth || document.documentElement.clientWidth;
|
||||
if (width < 960) {
|
||||
window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>');
|
||||
} else {
|
||||
var loadJs = function(d, a) {
|
||||
var c = document.getElementsByTagName("head")[0] || document.head || document.documentElement;
|
||||
var b = document.createElement("script");
|
||||
b.setAttribute("type", "text/javascript");
|
||||
b.setAttribute("charset", "UTF-8");
|
||||
b.setAttribute("src", d);
|
||||
if (typeof a === "function") {
|
||||
if (window.attachEvent) {
|
||||
b.onreadystatechange = function() {
|
||||
var e = b.readyState;
|
||||
if (e === "loaded" || e === "complete") {
|
||||
b.onreadystatechange = null;
|
||||
a()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
b.onload = a
|
||||
}
|
||||
}
|
||||
c.appendChild(b)
|
||||
};
|
||||
loadJs("https://changyan.sohu.com/upload/changyan.js", function() {
|
||||
window.changyan.api.config({
|
||||
appid: appid,
|
||||
conf: conf
|
||||
})
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<% } else { %>
|
||||
<div id="SOHUCS" sid="<%= page.permalink %>"></div>
|
||||
<% } %>
|
16
themes/hueman/layout/comment/counter.ejs
Normal file
16
themes/hueman/layout/comment/counter.ejs
Normal file
@@ -0,0 +1,16 @@
|
||||
<% if (post.comments) { %>
|
||||
<span class="comment-counter">
|
||||
<i class="fa fa-comments-o"></i>
|
||||
<% if (theme.comment.disqus) { %>
|
||||
<span class="disqus-comment-count" data-disqus-identifier="<%= post.disqusId || '' %>" data-disqus-url="<%= post.permalink %>">0</span>
|
||||
<% } else if (theme.comment.duoshuo) { %>
|
||||
<span class="ds-thread-count" data-thread-key="<%= post.path %>">0</span>
|
||||
<% } else if (theme.comment.isso) { %>
|
||||
<span><a href="<%= post.permalink %>#isso-thread"></a></span>
|
||||
<% } else if (theme.comment.facebook) { %>
|
||||
<span class="fb-comments-count" data-href="<%= post.permalink %>">0</span>
|
||||
<% } else if (theme.comment.changyan.on) { %>
|
||||
<span class="cy_cmt_count" id="sourceId::<%= post.permalink %>">0</span>
|
||||
<% } %>
|
||||
</span>
|
||||
<% } %>
|
22
themes/hueman/layout/comment/disqus.ejs
Normal file
22
themes/hueman/layout/comment/disqus.ejs
Normal file
@@ -0,0 +1,22 @@
|
||||
<% if (typeof(script) !== 'undefined' && script) { %>
|
||||
<script>
|
||||
var disqus_shortname = '<%= theme.comment.disqus %>';
|
||||
<% if (page.disqusId) { %>
|
||||
var disqus_identifier = '<%= page.disqusId || page.slug %>';
|
||||
<% } %>
|
||||
<% if (page.permalink) { %>
|
||||
var disqus_url = '<%= page.permalink %>';
|
||||
<% } %>
|
||||
(function() {
|
||||
var dsq = document.createElement('script');
|
||||
dsq.type = 'text/javascript';
|
||||
dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/<% if (page.comments) { %>embed.js<% } else { %>count.js<% } %>';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<% } else { %>
|
||||
<div id="disqus_thread">
|
||||
<noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
</div>
|
||||
<% } %>
|
52
themes/hueman/layout/comment/duoshuo.ejs
Normal file
52
themes/hueman/layout/comment/duoshuo.ejs
Normal file
@@ -0,0 +1,52 @@
|
||||
<% if (typeof(script) !== 'undefined' && script) { %>
|
||||
<script type="text/javascript">
|
||||
var duoshuoQuery = {short_name:'<%= theme.comment.duoshuo %>'};
|
||||
(function() {
|
||||
var ds = document.createElement('script');
|
||||
ds.type = 'text/javascript';ds.async = true;
|
||||
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
|
||||
ds.charset = 'UTF-8';
|
||||
(document.getElementsByTagName('head')[0]
|
||||
|| document.getElementsByTagName('body')[0]).appendChild(ds);
|
||||
})();
|
||||
</script>
|
||||
<% } else { %>
|
||||
<div class="ds-thread" data-thread-key="<%= post.path %>" data-title="<%= post.title %>" data-url="<%= page.permalink %>"></div>
|
||||
<style>
|
||||
#ds-thread #ds-reset .ds-textarea-wrapper {
|
||||
background: none;
|
||||
}
|
||||
#ds-reset .ds-avatar img {
|
||||
box-shadow: none;
|
||||
}
|
||||
#ds-reset .ds-gradient-bg {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
#ds-thread #ds-reset li.ds-tab a {
|
||||
border-radius: 3px;
|
||||
}
|
||||
#ds-thread #ds-reset .ds-post-button {
|
||||
color: white;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
background: #d32;
|
||||
text-shadow: none;
|
||||
font-weight: normal;
|
||||
font-family: 'Microsoft Yahei';
|
||||
}
|
||||
#ds-thread #ds-reset .ds-post-button:hover {
|
||||
color: white;
|
||||
background: #DE594C;
|
||||
}
|
||||
#ds-thread #ds-reset .ds-post-button:active {
|
||||
background: #d32;
|
||||
}
|
||||
#ds-smilies-tooltip ul.ds-smilies-tabs li a.ds-current {
|
||||
color: white;
|
||||
background: #d32;
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
</style>
|
||||
<% } %>
|
11
themes/hueman/layout/comment/facebook.ejs
Normal file
11
themes/hueman/layout/comment/facebook.ejs
Normal file
@@ -0,0 +1,11 @@
|
||||
<% if (typeof(script) !== 'undefined' && script) { %>
|
||||
<script>(function(d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) return;
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/<%= config.language ? config.language.split('-').join('_') : 'en' %>/sdk.js#xfbml=1&version=v2.8";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));</script>
|
||||
<% } else { %>
|
||||
<div class="fb-comments" data-width="100%" data-href="<%= page.permalink %>" data-num-posts="5"></div>
|
||||
<% } %>
|
22
themes/hueman/layout/comment/index.ejs
Normal file
22
themes/hueman/layout/comment/index.ejs
Normal file
@@ -0,0 +1,22 @@
|
||||
<% if (post.comments) { %>
|
||||
<section id="comments">
|
||||
<% if (theme.comment.disqus) { %>
|
||||
<%- partial('comment/disqus') %>
|
||||
<% } else if (theme.comment.duoshuo) { %>
|
||||
<%- partial('comment/duoshuo') %>
|
||||
<% } else if (theme.comment.youyan) { %>
|
||||
<%- partial('comment/youyan') %>
|
||||
<% } else if (theme.comment.livere) { %>
|
||||
<%- partial('comment/livere') %>
|
||||
<% } else if (theme.comment.facebook) { %>
|
||||
<%- partial('comment/facebook') %>
|
||||
<% } else if (typeof(theme.comment.isso) === 'string'
|
||||
|| theme.comment.isso && theme.comment.isso.on) { %>
|
||||
<%- partial('comment/isso') %>
|
||||
<% } else if (theme.comment.changyan.on) { %>
|
||||
<%- partial('comment/changyan') %>
|
||||
<% } else if (theme.comment.valine.on) { %>
|
||||
<%- partial('comment/valine') %>
|
||||
<% } %>
|
||||
</section>
|
||||
<% } %>
|
29
themes/hueman/layout/comment/isso.ejs
Normal file
29
themes/hueman/layout/comment/isso.ejs
Normal file
@@ -0,0 +1,29 @@
|
||||
<%
|
||||
if (typeof(script) !== 'undefined' && script) {
|
||||
let isso = theme.comment.isso;
|
||||
let issoSite = (typeof(isso) === 'string' ? isso : isso.site);
|
||||
if (isso === issoSite) { //isso is a string
|
||||
//TODO: maybe something better error logging
|
||||
console.warn('WARN Specifying property "comment.isso" as a ' +
|
||||
'string is deprecated. Please consider using the object form. See ' +
|
||||
'the respective _config.yml.example file for an example.');
|
||||
}
|
||||
%>
|
||||
<script data-isso="//<%= issoSite %>"
|
||||
<%
|
||||
let props = ['css', 'lang', 'reply_to_self', 'require_author',
|
||||
'require_email', 'max_comments_top', 'max_comments_nested',
|
||||
'reveal_on_click', 'avatar', 'avatar_bg', 'avatar_fg', 'vote',
|
||||
'vote_levels'];
|
||||
for (var p of props) {
|
||||
if (theme.comment.isso[p]) { %>
|
||||
<%= 'data-isso-' + p.replace('_', '-') %> =
|
||||
"<%= theme.comment.isso[p] %>"
|
||||
<% } %>
|
||||
<% } %>
|
||||
src="//<%= issoSite %>/js/embed.min.js">
|
||||
</script>
|
||||
<% } else { %>
|
||||
<section id="isso-thread"></section>
|
||||
<% } %>
|
||||
|
22
themes/hueman/layout/comment/livere.ejs
Normal file
22
themes/hueman/layout/comment/livere.ejs
Normal file
@@ -0,0 +1,22 @@
|
||||
<% if (typeof(script) !== 'undefined' && script) { %>
|
||||
|
||||
<!-- 来必力City版安装代码 -->
|
||||
<script type="text/javascript">
|
||||
(function(d, s) {
|
||||
var j, e = d.getElementsByTagName(s)[0];
|
||||
|
||||
if (typeof LivereTower === 'function') { return; }
|
||||
|
||||
j = d.createElement(s);
|
||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
||||
j.async = true;
|
||||
|
||||
e.parentNode.insertBefore(j, e);
|
||||
})(document, 'script');
|
||||
</script>
|
||||
<noscript> 为正常使用来必力评论功能请激活JavaScript</noscript>
|
||||
<!-- City版安装代码已完成 -->
|
||||
|
||||
<% } else { %>
|
||||
<div id="lv-container" data-id="city" data-uid=<%= theme.comment.livere %>></div>
|
||||
<% } %>
|
18
themes/hueman/layout/comment/scripts.ejs
Normal file
18
themes/hueman/layout/comment/scripts.ejs
Normal file
@@ -0,0 +1,18 @@
|
||||
<% if (theme.comment.disqus) { %>
|
||||
<%- partial('comment/disqus', { script: true }) %>
|
||||
<% } else if (theme.comment.duoshuo) { %>
|
||||
<%- partial('comment/duoshuo', { script: true }) %>
|
||||
<% } else if (theme.comment.youyan) { %>
|
||||
<%- partial('comment/youyan', { script: true }) %>
|
||||
<% } else if (theme.comment.livere) { %>
|
||||
<%- partial('comment/livere', { script: true }) %>
|
||||
<% } else if (theme.comment.facebook) { %>
|
||||
<%- partial('comment/facebook', { script: true }) %>
|
||||
<% } else if (typeof(theme.comment.isso) === 'string'
|
||||
|| theme.comment.isso && theme.comment.isso.on) { %>
|
||||
<%- partial('comment/isso', { script: true }) %>
|
||||
<% } else if (theme.comment.changyan.on) { %>
|
||||
<%- partial('comment/changyan', { script: true }) %>
|
||||
<% } else if (theme.comment.valine.on) { %>
|
||||
<%- partial('comment/valine', { script: true }) %>
|
||||
<% } %>
|
19
themes/hueman/layout/comment/valine.ejs
Normal file
19
themes/hueman/layout/comment/valine.ejs
Normal file
@@ -0,0 +1,19 @@
|
||||
<% if (typeof(script) !== 'undefined' && script) { %>
|
||||
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
|
||||
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
|
||||
<script>
|
||||
new Valine({
|
||||
el: '#valine-thread' ,
|
||||
notify:<%= theme.comment.valine.notify %>,
|
||||
verify:<%= theme.comment.valine.verify %>,
|
||||
app_id: '<%= theme.comment.valine.appId %>',
|
||||
app_key: '<%= theme.comment.valine.appKey %>',
|
||||
placeholder: '<%= theme.comment.valine.placeholder %>',
|
||||
pageSize: '<%= theme.comment.valine.pageSize %>',
|
||||
avatar: '<%= theme.comment.valine.avatar %>',
|
||||
avatar_cdn: '<%= theme.comment.valine.avatar_cdn %>'
|
||||
});
|
||||
</script>
|
||||
<% } else { %>
|
||||
<div id="valine-thread"></div>
|
||||
<% } %>
|
5
themes/hueman/layout/comment/youyan.ejs
Normal file
5
themes/hueman/layout/comment/youyan.ejs
Normal file
@@ -0,0 +1,5 @@
|
||||
<% if (typeof(script) !== 'undefined' && script) { %>
|
||||
<script type="text/javascript" src="//v2.uyan.cc/code/uyan.js?uid=<%= theme.comment.youyan %>"></script>
|
||||
<% } else { %>
|
||||
<div id="uyan_frame"></div>
|
||||
<% } %>
|
Reference in New Issue
Block a user