Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/reuixiy/hugo-theme-meme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMakise Von <v.makise@foxmail.com>2022-10-30 06:06:21 +0300
committerGitHub <noreply@github.com>2022-10-30 06:06:21 +0300
commitb8b3a82ad2cd5bf350629faf12ae82bb359f67f8 (patch)
tree3e70db200ed7fbc6aea04ba7cf24321a664e223a
parent4d5a1e6f086570762693c3a63ddf58ff015ffa30 (diff)
feat: support gitalk fully (#410)HEADmaster
-rw-r--r--config-examples/en/config.toml31
-rw-r--r--config-examples/zh-cn/config.toml31
-rw-r--r--config-examples/zh-tw/config.toml31
-rw-r--r--layouts/partials/third-party/gitalk.html41
4 files changed, 119 insertions, 15 deletions
diff --git a/config-examples/en/config.toml b/config-examples/en/config.toml
index a387e09..d55d2b7 100644
--- a/config-examples/en/config.toml
+++ b/config-examples/en/config.toml
@@ -696,13 +696,38 @@ uglyURLs = false
gitalkRepo = "your_repository"
gitalkOwner = "your_gitalk_owner"
gitalkAdmin = ["your_gitalk_admin"]
- gitalkLable = ["Gitalk"]
- gitalkDistractionFreeMode = false
- gitalkPerPage = 10
+
+ # 1. default (`location.href`)
+ # 2. pathname (`location.pathname`)
+ # 3. hash (hash_filepath)
+ # 4. custom:your_gitalk_id ("your_gitalk_id")
+ gitalkID = "pathname"
+
+ gitalkNumber = -1
+ gitalkLables = ["Gitalk"]
+
+ # 1. default (`document.title`)
+ # 2. custom:your_gitalk_title ("your_gitalk_title")
+ gitalkTitle = "default"
+
+ # 1. default (`location.href` + header.meta[description])
+ # 2. href (`location.href`)
+ # 3. custom:your_gitalk_body ("your_gitalk_body")
+ gitalkBody = "default"
+
+ # 1. default (`navigator.language || navigator.userLanguage`)
+ # 2. Support [en, zh-CN, zh-TW, es-ES, fr, ru, de, pl, ko, fa, ja]
gitalkLanguage = "en"
+
+ gitalkPerPage = 10
+ gitalkDistractionFreeMode = false
gitalkPagerDirection = "last"
gitalkCreateIssueManually = false
gitalkProxy = "https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token"
+ gitalkStaggerDelayBy = 150
+ gitalkAppearAnimation = "accordionVertical"
+ gitalkEnterAnimation = "accordionVertical"
+ gitalkLeaveAnimation = "accordionVertical"
gitalkEnableHotKey = true
# Note: https://github.com/gitalk/gitalk
diff --git a/config-examples/zh-cn/config.toml b/config-examples/zh-cn/config.toml
index f739e42..28dfe79 100644
--- a/config-examples/zh-cn/config.toml
+++ b/config-examples/zh-cn/config.toml
@@ -643,13 +643,38 @@ uglyURLs = false
gitalkRepo = "your_repository"
gitalkOwner = "your_gitalk_owner"
gitalkAdmin = ["your_gitalk_admin"]
- gitalkLable = ["Gitalk"]
- gitalkDistractionFreeMode = false
+
+ # 1. default (`location.href`)
+ # 2. pathname (`location.pathname`)
+ # 3. hash (hash_filepath)
+ # 4. custom:your_gitalk_id ("your_gitalk_id")
+ gitalkID = "pathname"
+
+ gitalkNumber = -1
+ gitalkLables = ["Gitalk"]
+
+ # 1. default (`document.title`)
+ # 2. custom:your_gitalk_title ("your_gitalk_title")
+ gitalkTitle = "default"
+
+ # 1. default (`location.href` + header.meta[description])
+ # 2. href (`location.href`)
+ # 3. custom:your_gitalk_body ("your_gitalk_body")
+ gitalkBody = "default"
+
+ # 1. default (`navigator.language || navigator.userLanguage`)
+ # 2. Support [en, zh-CN, zh-TW, es-ES, fr, ru, de, pl, ko, fa, ja]
+ gitalkLanguage = "zh-CN"
+
gitalkPerPage = 10
- gitalkLanguage = "en"
+ gitalkDistractionFreeMode = false
gitalkPagerDirection = "last"
gitalkCreateIssueManually = false
gitalkProxy = "https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token"
+ gitalkStaggerDelayBy = 150
+ gitalkAppearAnimation = "accordionVertical"
+ gitalkEnterAnimation = "accordionVertical"
+ gitalkLeaveAnimation = "accordionVertical"
gitalkEnableHotKey = true
# 说明:https://github.com/gitalk/gitalk
diff --git a/config-examples/zh-tw/config.toml b/config-examples/zh-tw/config.toml
index 446786d..3424bf9 100644
--- a/config-examples/zh-tw/config.toml
+++ b/config-examples/zh-tw/config.toml
@@ -643,13 +643,38 @@ uglyURLs = false
gitalkRepo = "your_repository"
gitalkOwner = "your_gitalk_owner"
gitalkAdmin = ["your_gitalk_admin"]
- gitalkLable = ["Gitalk"]
- gitalkDistractionFreeMode = false
+
+ # 1. default (`location.href`)
+ # 2. pathname (`location.pathname`)
+ # 3. hash (hash_filepath)
+ # 4. custom:your_gitalk_id ("your_gitalk_id")
+ gitalkID = "pathname"
+
+ gitalkNumber = -1
+ gitalkLables = ["Gitalk"]
+
+ # 1. default (`document.title`)
+ # 2. custom:your_gitalk_title ("your_gitalk_title")
+ gitalkTitle = "default"
+
+ # 1. default (`location.href` + header.meta[description])
+ # 2. href (`location.href`)
+ # 3. custom:your_gitalk_body ("your_gitalk_body")
+ gitalkBody = "default"
+
+ # 1. default (`navigator.language || navigator.userLanguage`)
+ # 2. Support [en, zh-CN, zh-TW, es-ES, fr, ru, de, pl, ko, fa, ja]
+ gitalkLanguage = "zh-TW"
+
gitalkPerPage = 10
- gitalkLanguage = "en"
+ gitalkDistractionFreeMode = false
gitalkPagerDirection = "last"
gitalkCreateIssueManually = false
gitalkProxy = "https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token"
+ gitalkStaggerDelayBy = 150
+ gitalkAppearAnimation = "accordionVertical"
+ gitalkEnterAnimation = "accordionVertical"
+ gitalkLeaveAnimation = "accordionVertical"
gitalkEnableHotKey = true
# 說明:https://github.com/gitalk/gitalk
diff --git a/layouts/partials/third-party/gitalk.html b/layouts/partials/third-party/gitalk.html
index 0d3f1b8..de5a0ad 100644
--- a/layouts/partials/third-party/gitalk.html
+++ b/layouts/partials/third-party/gitalk.html
@@ -34,15 +34,44 @@
repo: {{ .Site.Params.gitalkRepo }},
owner: {{ .Site.Params.gitalkOwner }},
admin: {{ .Site.Params.gitalkAdmin }},
- labels: {{ .Site.Params.gitalkLable }},
- distractionFreeMode: {{ .Site.Params.gitalkDistractionFreeMode }},
- perPage: {{ .Site.Params.gitalkPerPage }},
+
+ {{ if eq .Site.Params.gitalkID "pathname" }}
+ id: location.pathname,
+ {{ else if eq .Site.Params.gitalkID "hash" }}
+ id: {{ .File.UniqueID }},
+ {{ else if hasPrefix .Site.Params.gitalkID "custom:" }}
+ id: {{ strings.TrimPrefix "custom:" .Site.Params.gitalkID }},
+ {{ end }}
+
+ number: {{ .Site.Params.gitalkNumber }},
+ labels: {{ .Site.Params.gitalkLables }},
+
+ {{ if hasPrefix .Site.Params.gitalkTitle "custom:" }}
+ title: {{ strings.TrimPrefix "custom:" .Site.Params.gitalkTitle }},
+ {{ end }}
+
+ {{ if eq .Site.Params.gitalkBody "href" }}
+ body: location.href,
+ {{ else if hasPrefix .Site.Params.gitalkBody "custom:" }}
+ body: {{ strings.TrimPrefix "custom:" .Site.Params.gitalkBody }},
+ {{ end }}
+
+ {{ if ne .Site.Params.gitalkLanguage "default" }}
language: {{ .Site.Params.gitalkLanguage }},
+ {{ end }}
+
+ perPage: {{ .Site.Params.gitalkPerPage }},
+ distractionFreeMode: {{ .Site.Params.gitalkDistractionFreeMode }},
pagerDirection: {{ .Site.Params.gitalkPagerDirection }},
- createIssueManually: {{ .Site.Params.gitalkDistractionFreeMode }},
+ createIssueManually: {{ .Site.Params.gitalkCreateIssueManually }},
proxy: {{ .Site.Params.gitalkProxy }},
- enableHotKey: {{ .Site.Params.gitalkEnableHotKey }},
- id: location.pathname
+ flipMoveOptions: {
+ staggerDelayBy: {{ .Site.Params.gitalkStaggerDelayBy }},
+ appearAnimation: {{ .Site.Params.gitalkAppearAnimation }},
+ enterAnimation: {{ .Site.Params.gitalkEnterAnimation }},
+ leaveAnimation: {{ .Site.Params.gitalkLeaveAnimation }}
+ },
+ enableHotKey: {{ .Site.Params.gitalkEnableHotKey }}
})
gitalk.render('gitalk-container')