-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.yaml
More file actions
98 lines (96 loc) · 3.11 KB
/
Copy pathplugin.yaml
File metadata and controls
98 lines (96 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
id: comments
name: Comments
version: 0.1.0
apiVersion: kite/plugin/v1
requires: ">=0.1.0 <2.0.0"
description: A comment thread under every post, with Giscus, Waline or Twikoo.
author:
name: Kite
url: https://github.com/kite-plus
license: Apache-2.0
homepage: https://github.com/kite-plus/plugin-comments
hosts: [giscus.app, cdn.jsdelivr.net, unpkg.com, registry.npmmirror.com]
# The thread goes at the end of the page's main content, or into an element
# marked data-kite-comments where a theme has one. A post leaves it out with
# comments: false in its front matter.
inject:
- at: body
pages: [single]
kinds: [post]
skip: {comments: false}
html: &thread |
<script>window.KiteComments = {settings: {{ .Settings }}, page: {{ .Page.ID }}, lang: {{ .Site.Language }}};</script>
<script src="{{ asset "comments.js" }}" defer></script>
- at: body
pages: [single]
kinds: [page]
when: {on_pages: true}
skip: {comments: false}
html: *thread
settings:
- key: provider
type: select
label: Service
default: giscus
options:
- {value: giscus, label: Giscus}
- {value: waline, label: Waline}
- {value: twikoo, label: Twikoo}
- key: repo
type: string
label: Repository
help: The public GitHub repository whose Discussions hold the comments, with the giscus app installed on it.
placeholder: owner/repo
showIf: {provider: giscus}
- key: repo_id
type: string
label: Repository ID
help: Shown as data-repo-id on giscus.app once the repository is chosen there.
placeholder: R_kgDOxxxxxxx
showIf: {provider: giscus}
- key: category
type: string
label: Discussion category
placeholder: Announcements
showIf: {provider: giscus}
- key: category_id
type: string
label: Category ID
help: Shown as data-category-id on giscus.app once the category is chosen there.
placeholder: DIC_kwDOxxxxxxx
showIf: {provider: giscus}
- key: mapping
type: select
label: Match a post to its discussion by
default: id
options:
- {value: id, label: The post's id, which stays when its address changes}
- {value: pathname, label: The path of its address}
- {value: url, label: Its whole address}
- {value: title, label: Its title}
showIf: {provider: giscus}
- key: server
type: url
label: Server address
help: Where your Waline server is deployed.
placeholder: https://comments.example.com
showIf: {provider: waline}
- key: env
type: string
label: Environment
help: The address of your Twikoo server, or the environment ID on Tencent CloudBase.
placeholder: https://twikoo.example.com
showIf: {provider: twikoo}
- key: on_pages
type: boolean
label: Under pages too
help: Also put a thread under pages, such as About, and not only under posts.
- key: cdn
type: select
label: Load scripts from
help: Where Waline and Twikoo load from. npmmirror is quicker from mainland China.
default: jsdelivr
options:
- {value: jsdelivr, label: jsDelivr}
- {value: unpkg, label: unpkg}
- {value: npmmirror, label: npmmirror}