2022-12-11 14:33:10 +08:00
|
|
|
<script>
|
|
|
|
function load_artalk() {
|
|
|
|
if (!document.querySelectorAll("#artalk_container")[0]) return;
|
2024-02-12 23:07:56 +08:00
|
|
|
utils.css('<%- theme.comments.artalk.css %>');
|
|
|
|
utils.js('<%- theme.comments.artalk.js %>', {defer: true}).then(function () {
|
2022-12-11 14:33:10 +08:00
|
|
|
const el = document.getElementById("artalk_container");
|
|
|
|
var path = el.getAttribute('comment_id');
|
|
|
|
if (!path) {
|
|
|
|
path = decodeURI(window.location.pathname);
|
|
|
|
}
|
2023-12-30 12:21:01 +08:00
|
|
|
var artalk = Artalk.init({
|
2022-12-11 14:33:10 +08:00
|
|
|
el: '#artalk_container',
|
|
|
|
pageKey: path,
|
2024-01-18 12:33:12 +08:00
|
|
|
pageTitle: '<%= page.title %>',
|
2022-12-11 14:33:10 +08:00
|
|
|
server: '<%= theme.comments.artalk.server %>',
|
|
|
|
placeholder: '<%= theme.comments.artalk.placeholder %>',
|
|
|
|
site: '<%= config.title %>',
|
|
|
|
darkMode: '<%= theme.comments.artalk.darkMode %>'
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
window.addEventListener('DOMContentLoaded', (event) => {
|
|
|
|
load_artalk();
|
|
|
|
});
|
|
|
|
</script>
|