-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
143 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## Options | ||
|
||
| Option | Description | Required | Default | | ||
| :---------------- | :--------------- | :------- | :------ | | ||
| repo | Repository | Yes | - - | | ||
| repo-id | Repository ID | Yes | - - | | ||
| category | Category | Yes | - - | | ||
| category-id | Category ID | Yes | - - | | ||
| reactions-enabled | Enable reactions | No | 1 | | ||
| theme | Theme | No | light | | ||
| lang | Language | No | en | | ||
|
||
## Example | ||
|
||
<!-- embed ignore begin --> | ||
|
||
```text | ||
{% embed giscus repo="MR-Addict/mdbook-embedify" repo-id="R_kgDOLCxX0Q" category="General" category-id="DIC_kwDOLCxX0c4CdGx-" theme="light" %} | ||
``` | ||
|
||
<!-- embed ignore end --> | ||
|
||
This book's giscus is enabled, you can see it at the bottom of this page. And you can also have a try by commenting below. | ||
|
||
However, you may want to enable it for the whole book. You can do this by adding below options to `book.toml` file: | ||
|
||
```toml | ||
giscus.enable = true | ||
giscus.repo = "MR-Addict/mdbook-embedify" | ||
giscus.repo-id = "R_kgDOLCxX0Q" | ||
giscus.category = "General" | ||
giscus.category-id = "DIC_kwDOLCxX0c4CdGx" | ||
giscus.reactions-enabled = "1" | ||
giscus.theme = "light" | ||
giscus.lang = "en" | ||
``` | ||
|
||
## Good to know | ||
|
||
Giscus is a comments system powered by GitHub Discussions. It's a great way to have discussions about our book. But it's only supported while your app is deployed. You can't see it if you open it with **file://** protocol. | ||
|
||
The simple way is to serve your book with a static server. For example: | ||
|
||
**python installed** | ||
|
||
```sh | ||
python -m http.server --directory book | ||
``` | ||
|
||
**node.js installed** | ||
|
||
```sh | ||
npx serve book | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<style> | ||
.giscus { | ||
margin-top: 6rem; | ||
} | ||
</style> | ||
|
||
<script | ||
src="{% src|https://giscus.app/client.js %}" | ||
data-repo="{% repo %}" | ||
data-repo-id="{% repo-id %}" | ||
data-category="{% category %}" | ||
data-category-id="{% category-id %}" | ||
data-mapping="title" | ||
data-strict="0" | ||
data-reactions-enabled="{% reactions-enabled|1 %}" | ||
data-emit-metadata="0" | ||
data-input-position="bottom" | ||
data-theme="{% theme|light %}" | ||
data-lang="{% lang|en %}" | ||
data-loading="lazy" | ||
crossorigin="anonymous" | ||
async | ||
></script> |