71 lines
2.6 KiB
HTML
71 lines
2.6 KiB
HTML
<!-- CSS -->
|
|
<!-- <link href="/css/Artalk.css" rel="stylesheet" /> -->
|
|
<style>
|
|
.atk-loading{
|
|
background: #FFFFFF;
|
|
}
|
|
/*对artalk评论暗夜模式进行微调*/
|
|
@media (prefers-color-scheme: dark) {
|
|
.atk-pinned-badge {
|
|
color: #ffffff !important;
|
|
background: #ff6262 !important;
|
|
}
|
|
}
|
|
[data-theme="dark"] .atk-pinned-badge {
|
|
color: #ffffff !important;
|
|
background: #ff6262 !important;
|
|
}
|
|
</style>
|
|
<!-- Artalk -->
|
|
<div id="Comments" uk-scrollspy="target: > *; cls: uk-animation-slide-bottom-small; delay: 100">
|
|
<!-- Loading Skeleton -->
|
|
<div class="atk-loading-placeholder">
|
|
<div class="atk-loading-item">
|
|
<div class="atk-loading-avatar"></div>
|
|
<div class="atk-loading-content">
|
|
<div class="atk-loading-line width-name"></div>
|
|
<div class="atk-loading-line width-80"></div>
|
|
<div class="atk-loading-line width-60"></div>
|
|
</div>
|
|
</div>
|
|
<div class="atk-loading-item">
|
|
<div class="atk-loading-avatar"></div>
|
|
<div class="atk-loading-content">
|
|
<div class="atk-loading-line width-name"></div>
|
|
<div class="atk-loading-line width-60"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- JS -->
|
|
<!-- <script src="/js/Artalk.js"></script> -->
|
|
<script>
|
|
// Configuration for Artalk and AI Comment
|
|
window.artalkConfig = {
|
|
el: '#Comments',
|
|
server: '{{ .Site.Params.artalk.server }}',
|
|
site: '{{ .Site.Params.artalk.site }}',
|
|
pageKey: '{{ .RelPermalink }}',
|
|
emoticons: '{{ .Site.Params.artalk.emoticons | relURL }}',
|
|
aiComment: {{ if .Params.ai_comment }}
|
|
{{ $avatar := .Site.Params.ai.avatar }}
|
|
{{ if not $avatar }}{{ $avatar = .Site.Params.author.avatar }}{{ end }}
|
|
{{ if not $avatar }}{{ $avatar = "https://cravatar.cn/avatar/unknown?d=mp" }}{{ end }}
|
|
{{ dict "content" .Params.ai_comment "avatar" $avatar "name" (.Site.Params.ai.name | default "AI Assistant") "date" (.Date.Format "2006-01-02") | jsonify | safeJS }}
|
|
{{ else }}null{{ end }}
|
|
};
|
|
|
|
// Execute Initialization immediately if function exists (PJAX re-execution),
|
|
// otherwise wait for DOMContentLoaded (Initial load)
|
|
(function() {
|
|
if (typeof window.initArtalk === 'function') {
|
|
window.initArtalk();
|
|
} else {
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
if (typeof window.initArtalk === 'function') {
|
|
window.initArtalk();
|
|
}
|
|
});
|
|
}
|
|
})();
|
|
</script> |