Skip to content

Commit

Permalink
Merge pull request #51 from donghao1393/feature/giscus.app
Browse files Browse the repository at this point in the history
add support for comment from giscus.app
  • Loading branch information
not-matthias authored Feb 26, 2024
2 parents a20f4ad + f96aff1 commit 4b9787d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ cp -r themes/apollo/content content

## Options

### Comment

You can enable comment (Giscus) for each page:

```toml
[extra]
comment = true
```

And then save your script from [Giscus](https://giscus.app) to `templates/_giscus_script.html`.

### Additional stylesheets

You can add stylesheets to override the theme:
Expand Down
3 changes: 2 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ toc = true
use_cdn = false
favicon = "/icon/favicon.png"
theme = "toggle" # light, dark, auto, toggle
comment = false
# mathjax = true
# mathjax_dollar_inline_enable = true

Expand All @@ -39,4 +40,4 @@ host = "example.com" # default= goatcounter.com

[extra.analytics.umami]
website_id = "43929cd1-1e83...."
host_url = "https://stats.mywebsite.com" # default: https://analytics.eu.umami.is
host_url = "https://stats.mywebsite.com" # default: https://analytics.eu.umami.is
7 changes: 6 additions & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
{% block main_content %}
Nothing here?!
{% endblock main_content %}
{% if page.extra.comment is defined %}{% set show_comment = page.extra.comment %}{% else %}{% set show_comment = config.extra.comment %}{% endif %}
{% if show_comment %}
<div class="giscus"></div>
{% include "_giscus_script.html" %}
{% endif %}
</div>
</body>

</html>
</html>

0 comments on commit 4b9787d

Please sign in to comment.