blog/themes/fluid/layout/_partials/comments/twikoo.ejs
2024-11-16 11:34:10 +08:00

26 lines
929 B
Plaintext

<% 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>
<% } %>