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

25 lines
928 B
Plaintext

<% 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.min.css') %>')
Fluid.utils.createScript('<%= url_join(theme.static_prefix.waline, 'waline.min.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>
<% } %>