mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-27 12:03:49 +01:00
feat: add Vssue comment (#197)
* 添加Vssue评论插件 * 修复默认代理过期问题 * style(comment/vssue): format html Co-authored-by: Jimmy Cai <github@jimmycai.com>
This commit is contained in:
parent
7dab67b358
commit
325303a7f8
2 changed files with 34 additions and 0 deletions
|
@ -60,6 +60,13 @@ params:
|
||||||
site:
|
site:
|
||||||
locale:
|
locale:
|
||||||
|
|
||||||
|
vssue:
|
||||||
|
platform:
|
||||||
|
owner:
|
||||||
|
repo:
|
||||||
|
clientId:
|
||||||
|
clientSecret:
|
||||||
|
|
||||||
widgets:
|
widgets:
|
||||||
enabled:
|
enabled:
|
||||||
- search
|
- search
|
||||||
|
|
27
layouts/partials/comments/provider/vssue.html
Normal file
27
layouts/partials/comments/provider/vssue.html
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{{- with .Site.Params.comments.vssue -}}
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/vssue/dist/vssue.min.css" />
|
||||||
|
|
||||||
|
<div id="vssue"></div>
|
||||||
|
|
||||||
|
<script src="https://unpkg.com/vue/dist/vue.runtime.min.js"></script>
|
||||||
|
<script src="https://unpkg.com/vssue/dist/vssue.{{ .platform }}.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
new Vue({
|
||||||
|
el: "#vssue",
|
||||||
|
render: (h) =>
|
||||||
|
h("Vssue", {
|
||||||
|
props: {
|
||||||
|
title: "{{ $.Title }}",
|
||||||
|
options: {
|
||||||
|
proxy: (url) => "https://cors-anywhere.azm.workers.dev/" + url,
|
||||||
|
owner: "{{ .owner }}",
|
||||||
|
repo: "{{ .repo }}",
|
||||||
|
clientId: "{{ .clientId }}",
|
||||||
|
clientSecret: "{{ .clientSecret }}",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{{- end -}}
|
Loading…
Reference in a new issue