2025-2-26-fixed
This commit is contained in:
11
themes/fluid/layout/_partials/comments/changyan.ejs
Normal file
11
themes/fluid/layout/_partials/comments/changyan.ejs
Normal file
@ -0,0 +1,11 @@
|
||||
<% if (theme.changyan.appid) { %>
|
||||
<div id="SOHUCS" sid='<%= page.permalink %>'></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#SOHUCS', function() {
|
||||
Fluid.utils.createScript("https://changyan.sohu.com/upload/changyan.js", function() {
|
||||
window.changyan.api.config(<%- JSON.stringify(theme.changyan || {}) %>)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
25
themes/fluid/layout/_partials/comments/cusdis.ejs
Normal file
25
themes/fluid/layout/_partials/comments/cusdis.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<% if (theme.cusdis.host && theme.cusdis.app_id) { %>
|
||||
<div class="cusdis" style="width:100%">
|
||||
<div id="cusdis_thread"
|
||||
data-host="<%= theme.cusdis.host %>"
|
||||
data-app-id="<%= theme.cusdis.app_id %>"
|
||||
data-page-id="<%= md5(page.path) %>"
|
||||
data-page-url="<%= page.path %>"
|
||||
data-page-title="<%= page.title %>"
|
||||
data-theme="<%= theme.dark_mode.default %>"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#cusdis_thread', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.cusdis.host,
|
||||
`/js/widget/lang/${ String(theme.cusdis.lang || 'zh-cn').toLowerCase() }.js`) %>');
|
||||
Fluid.utils.createScript('<%= url_join(theme.cusdis.host, 'js/cusdis.es.js') %>');
|
||||
var schema = document.documentElement.getAttribute('data-user-color-scheme');
|
||||
if (schema) {
|
||||
document.querySelector('#cusdis_thread').dataset.theme = schema
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
17
themes/fluid/layout/_partials/comments/discuss.ejs
Normal file
17
themes/fluid/layout/_partials/comments/discuss.ejs
Normal file
@ -0,0 +1,17 @@
|
||||
<% if (theme.discuss && theme.discuss.serverURLs) { %>
|
||||
<div id="discuss-comments"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#comments', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.discuss, 'discuss.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.discuss || {}) %>,
|
||||
{ el: '#discuss-comments',
|
||||
path: <%= theme.discuss.path %>
|
||||
}
|
||||
)
|
||||
discuss.init(options)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
32
themes/fluid/layout/_partials/comments/disqus.ejs
Normal file
32
themes/fluid/layout/_partials/comments/disqus.ejs
Normal file
@ -0,0 +1,32 @@
|
||||
<% if (theme.disqus.shortname) { %>
|
||||
<div class="disqus" style="width:100%">
|
||||
<div id="disqus_thread"></div>
|
||||
<% if (theme.disqus.disqusjs) { %>
|
||||
<script>
|
||||
Fluid.utils.loadComments('#disqus_thread', function() {
|
||||
Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.disqusjs, 'disqusjs.css') %>');
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.disqusjs, 'disqus.js') %>', function() {
|
||||
new DisqusJS({
|
||||
shortname: '<%= theme.disqus.shortname %>',
|
||||
apikey: '<%= theme.disqus.apikey %>'
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% } else { %>
|
||||
<script type="text/javascript">
|
||||
var disqus_config = function() {
|
||||
this.page.url = '<%= page.permalink %>';
|
||||
this.page.identifier = '<%= url_for(page.path) %>';
|
||||
};
|
||||
Fluid.utils.loadComments('#disqus_thread', function() {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = '//' + '<%= theme.disqus.shortname %>' + '.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
});
|
||||
</script>
|
||||
<% } %>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
</div>
|
||||
<% } %>
|
||||
36
themes/fluid/layout/_partials/comments/giscus.ejs
Normal file
36
themes/fluid/layout/_partials/comments/giscus.ejs
Normal file
@ -0,0 +1,36 @@
|
||||
<% if (theme.giscus && theme.giscus['repo'] && theme.giscus['repo-id']) { %>
|
||||
<div id="giscus" class="giscus"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#giscus', function() {
|
||||
var options = <%- JSON.stringify(theme.giscus || {}) %>;
|
||||
var attributes = {};
|
||||
for (let option in options) {
|
||||
if (!option.startsWith('theme-')) {
|
||||
var key = option.startsWith('data-') ? option : 'data-' + option;
|
||||
attributes[key] = options[option];
|
||||
}
|
||||
}
|
||||
var light = '<%= theme.giscus['theme-light'] || 'light' %>';
|
||||
var dark = '<%= theme.giscus['theme-dark'] || 'dark' %>';
|
||||
window.GiscusThemeLight = light;
|
||||
window.GiscusThemeDark = dark;
|
||||
attributes['data-theme'] = document.documentElement.getAttribute('data-user-color-scheme') === 'dark' ? dark : light;
|
||||
for (let attribute in attributes) {
|
||||
var value = attributes[attribute];
|
||||
if (value === undefined || value === null || value === '') {
|
||||
delete attributes[attribute];
|
||||
}
|
||||
}
|
||||
var s = document.createElement('script');
|
||||
s.setAttribute('src', 'https://giscus.app/client.js');
|
||||
s.setAttribute('crossorigin', 'anonymous');
|
||||
for (let attribute in attributes) {
|
||||
s.setAttribute(attribute, attributes[attribute]);
|
||||
}
|
||||
var ss = document.getElementsByTagName('script');
|
||||
var e = ss.length > 0 ? ss[ss.length - 1] : document.head || document.documentElement;
|
||||
e.parentNode.insertBefore(s, e.nextSibling);
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
19
themes/fluid/layout/_partials/comments/gitalk.ejs
Normal file
19
themes/fluid/layout/_partials/comments/gitalk.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
<% if(theme.gitalk.clientID && theme.gitalk.clientSecret && theme.gitalk.repo){ %>
|
||||
<div id="gitalk-container"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#gitalk-container', function() {
|
||||
Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.internal_css, 'gitalk.css') %>')
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.gitalk, 'gitalk.min.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.gitalk || {}) %>,
|
||||
{
|
||||
id: '<%= md5(page.path) %>'
|
||||
}
|
||||
)
|
||||
var gitalk = new Gitalk(options);
|
||||
gitalk.render('gitalk-container');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
10
themes/fluid/layout/_partials/comments/livere.ejs
Normal file
10
themes/fluid/layout/_partials/comments/livere.ejs
Normal file
@ -0,0 +1,10 @@
|
||||
<% if (theme.livere.uid) { %>
|
||||
<div id="lv-container" data-id="city" data-uid="<%= theme.livere.uid %>">
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#lv-container', function() {
|
||||
Fluid.utils.createScript('https://cdn-city.livere.com/js/embed.dist.js');
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
</div>
|
||||
<% } %>
|
||||
29
themes/fluid/layout/_partials/comments/remark42.ejs
Normal file
29
themes/fluid/layout/_partials/comments/remark42.ejs
Normal file
@ -0,0 +1,29 @@
|
||||
<% if (theme.remark42.host && theme.remark42.site_id) { %>
|
||||
<div id="remark42"></div>
|
||||
<script type="text/javascript">
|
||||
var schema = document.documentElement.getAttribute('data-user-color-scheme');
|
||||
if (schema !== 'light' && schema !== 'dark') {
|
||||
schema = 'light';
|
||||
}
|
||||
var remark_config = Object.assign(
|
||||
<%- JSON.stringify(theme.remark42 || {}) %>,
|
||||
{
|
||||
url: '<%= url_for(page.path) %>',
|
||||
page_title: '<%= page.title %>',
|
||||
theme: schema,
|
||||
}
|
||||
);
|
||||
|
||||
Fluid.utils.loadComments('#remark42', function() {
|
||||
(function (c) {
|
||||
for (var i = 0; i < c.length; i++) {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = remark_config.host + '/web/' + c[i] + '.js';
|
||||
s.defer = true;
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
})(remark_config.components || ['embed']);
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
25
themes/fluid/layout/_partials/comments/twikoo.ejs
Normal file
25
themes/fluid/layout/_partials/comments/twikoo.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<% if (theme.twikoo && theme.twikoo.envId) { %>
|
||||
<div id="twikoo"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#comments', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.twikoo, 'twikoo.all.min.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.twikoo || {}) %>,
|
||||
{
|
||||
el: '#twikoo',
|
||||
path: '<%= theme.twikoo.path %>',
|
||||
onCommentLoaded: function() {
|
||||
Fluid.utils.listenDOMLoaded(function() {
|
||||
var imgSelector = '#twikoo .tk-content img:not(.tk-owo-emotion)';
|
||||
Fluid.plugins.imageCaption(imgSelector);
|
||||
Fluid.plugins.fancyBox(imgSelector);
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
twikoo.init(options)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
27
themes/fluid/layout/_partials/comments/utterances.ejs
Normal file
27
themes/fluid/layout/_partials/comments/utterances.ejs
Normal file
@ -0,0 +1,27 @@
|
||||
<% if (theme.utterances.repo && theme.utterances.issue_term) { %>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#comments', function() {
|
||||
var light = '<%= theme.utterances.theme || 'github-light' %>';
|
||||
var dark = '<%= theme.utterances.theme_dark || 'github-dark' %>';
|
||||
var schema = document.documentElement.getAttribute('data-user-color-scheme');
|
||||
if (schema === 'dark') {
|
||||
schema = dark;
|
||||
} else {
|
||||
schema = light;
|
||||
}
|
||||
window.UtterancesThemeLight = light;
|
||||
window.UtterancesThemeDark = dark;
|
||||
var s = document.createElement('script');
|
||||
s.setAttribute('src', 'https://utteranc.es/client.js');
|
||||
s.setAttribute('repo', '<%= theme.utterances.repo %>');
|
||||
s.setAttribute('issue-term', '<%= theme.utterances.issue_term %>');
|
||||
<% if (theme.utterances.label) { %>
|
||||
s.setAttribute('label', '<%= theme.utterances.label %>');
|
||||
<% } %>
|
||||
s.setAttribute('theme', schema);
|
||||
s.setAttribute('crossorigin', 'anonymous');
|
||||
document.getElementById('comments').appendChild(s);
|
||||
})
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
23
themes/fluid/layout/_partials/comments/valine.ejs
Normal file
23
themes/fluid/layout/_partials/comments/valine.ejs
Normal file
@ -0,0 +1,23 @@
|
||||
<% if (theme.valine.appId && theme.valine.appKey) { %>
|
||||
<div id="valine"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#valine', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.valine, 'Valine.min.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.valine || {}) %>,
|
||||
{
|
||||
el: "#valine",
|
||||
path: <%= theme.valine.path %>
|
||||
}
|
||||
)
|
||||
new Valine(options);
|
||||
Fluid.utils.waitElementVisible('#valine .vcontent', () => {
|
||||
var imgSelector = '#valine .vcontent img:not(.vemoji)';
|
||||
Fluid.plugins.imageCaption(imgSelector);
|
||||
Fluid.plugins.fancyBox(imgSelector);
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
24
themes/fluid/layout/_partials/comments/waline.ejs
Normal file
24
themes/fluid/layout/_partials/comments/waline.ejs
Normal file
@ -0,0 +1,24 @@
|
||||
<% if (theme.waline.serverURL) { %>
|
||||
<div id="waline"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#waline', function() {
|
||||
Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.waline, 'waline.css') %>')
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.waline, 'waline.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.waline || {}) %>,
|
||||
{
|
||||
el: '#waline',
|
||||
path: <%= theme.waline.path %>
|
||||
}
|
||||
)
|
||||
Waline.init(options);
|
||||
Fluid.utils.waitElementVisible('#waline .vcontent', () => {
|
||||
var imgSelector = '#waline .vcontent img:not(.vemoji)';
|
||||
Fluid.plugins.imageCaption(imgSelector);
|
||||
Fluid.plugins.fancyBox(imgSelector);
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
Reference in New Issue
Block a user