diff options
author | 慕枫Go <javakang@qq.com> | 2021-04-26 19:27:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-26 19:27:44 +0300 |
commit | 325303a7f85bd95f7937325a9495744c56ce3935 (patch) | |
tree | b82661bd2d8b69097da684d7468cd15b179e1579 | |
parent | 7dab67b358b6419e1c182876d89cdfb49b9f5cc2 (diff) |
feat: add Vssue comment (#197)
* 添加Vssue评论插件
* 修复默认代理过期问题
* style(comment/vssue): format html
Co-authored-by: Jimmy Cai <github@jimmycai.com>
-rw-r--r-- | exampleSite/config.yaml | 7 | ||||
-rw-r--r-- | layouts/partials/comments/provider/vssue.html | 27 |
2 files changed, 34 insertions, 0 deletions
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 0c5c72f..2910cbb 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -60,6 +60,13 @@ params: site: locale: + vssue: + platform: + owner: + repo: + clientId: + clientSecret: + widgets: enabled: - search diff --git a/layouts/partials/comments/provider/vssue.html b/layouts/partials/comments/provider/vssue.html new file mode 100644 index 0000000..7072778 --- /dev/null +++ b/layouts/partials/comments/provider/vssue.html @@ -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 -}} |