添加移动端适配

This commit is contained in:
MeiK
2022-01-24 20:57:20 +08:00
parent 5e402f132c
commit 69ed2cc9c2
4 changed files with 1294 additions and 43917 deletions

View File

@@ -138,6 +138,20 @@ pygmentsUseClasses = true
userStatusEmoji = "😀"
favicon = "/images/github.png"
location = "China"
enableGitalk = true
[params.gitalk]
clientID = "Your client ID"
clientSecret = "Your client secret"
repo = "repo"
owner = "MeiK2333"
admin = "MeiK2333"
id = "location.pathname"
labels = "gitalk"
perPage = 15
pagerDirection = "last"
createIssueManually = true
distractionFreeMode = false
[[params.links]]
title = "Link"

View File

@@ -1,7 +1,7 @@
{{ if .Site.Params.enableGitalk }}
<div id="gitalk-container" style="margin:0 auto;width: 600px;height: auto"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>
<div id="gitalk-container" class="gitalk-container"></div>
<link rel="stylesheet" href='{{ "css/gitalk.css" | absURL }}'>
<script src='{{ "js/gitalk.min.js" | absURL }}'></script>
<script>
const gitalk = new Gitalk({
clientID: '{{ .Site.Params.Gitalk.clientID }}',
@@ -9,16 +9,11 @@
repo: '{{ .Site.Params.Gitalk.repo }}',
owner: '{{ .Site.Params.Gitalk.owner }}',
admin: ['{{ .Site.Params.Gitalk.owner }}'],
proxy: '{{ .Site.Params.gitalk.proxy }}',
id: location.pathname, // Ensure uniqueness and length less than 50
id: eval({{ .Site.Params.Gitalk.id }}), // Ensure uniqueness and length less than 50
distractionFreeMode: false // Facebook-like distraction free mode
});
(function() {
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
document.getElementById('gitalk-container').innerHTML = 'Gitalk comments not available by default when the website is previewed locally.';
return;
}
gitalk.render('gitalk-container');
})();
</script>
{{ end }}
{{ end }}

File diff suppressed because it is too large Load Diff

43357
static/js/gitalk.min.js vendored

File diff suppressed because one or more lines are too long