mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-27 12:03:49 +01:00
feat(comment): add Twikoo
support (#286)
* Create twikoo.html * Upgrade to Twikoo 1.4.3 and add `lang` param * Add twikoo section in config.yaml Co-authored-by: Jimmy Cai <github@jimmycai.com>
This commit is contained in:
parent
5f1a5ab83f
commit
7b51bea912
2 changed files with 49 additions and 1 deletions
|
@ -87,6 +87,12 @@ params:
|
||||||
locale:
|
locale:
|
||||||
admin: Admin
|
admin: Admin
|
||||||
|
|
||||||
|
twikoo:
|
||||||
|
envId:
|
||||||
|
region:
|
||||||
|
path:
|
||||||
|
lang:
|
||||||
|
|
||||||
widgets:
|
widgets:
|
||||||
enabled:
|
enabled:
|
||||||
- search
|
- search
|
||||||
|
|
42
layouts/partials/comments/provider/twikoo.html
Normal file
42
layouts/partials/comments/provider/twikoo.html
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/twikoo@1.4.3/dist/twikoo.all.min.js"></script>
|
||||||
|
<div id="tcomment"></div>
|
||||||
|
<style>
|
||||||
|
.twikoo {
|
||||||
|
background-color: var(--card-background);
|
||||||
|
border-radius: var(--card-border-radius);
|
||||||
|
box-shadow: var(--shadow-l1);
|
||||||
|
padding: var(--card-padding);
|
||||||
|
}
|
||||||
|
.twikoo .el-input-group__prepend,
|
||||||
|
.twikoo .tk-action-icon,
|
||||||
|
.twikoo .tk-time,
|
||||||
|
.twikoo .tk-comments-count,
|
||||||
|
.twikoo .el-button {
|
||||||
|
color: var(--body-text-color);
|
||||||
|
}
|
||||||
|
.twikoo .el-input__inner,
|
||||||
|
.twikoo .el-textarea__inner,
|
||||||
|
.twikoo .tk-preview-container,
|
||||||
|
.twikoo .tk-content,
|
||||||
|
.twikoo .tk-nick {
|
||||||
|
color: var(--card-text-color-main);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
{{- with .Site.Params.comments.twikoo -}}
|
||||||
|
<script>
|
||||||
|
twikoo.init({
|
||||||
|
envId: '{{- .envId -}}',
|
||||||
|
el: '#tcomment',
|
||||||
|
{{- with .region -}}
|
||||||
|
region: '{{- . -}}',
|
||||||
|
{{- end -}}
|
||||||
|
{{- with .path -}}
|
||||||
|
path: '{{- . -}}',
|
||||||
|
{{- end -}}
|
||||||
|
{{- with .lang -}}
|
||||||
|
lang: '{{- . -}}',
|
||||||
|
{{- end -}}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
{{- end -}}
|
Loading…
Reference in a new issue