Skip to content

Commit

Permalink
Setup giscus
Browse files Browse the repository at this point in the history
  • Loading branch information
cwecht committed Nov 5, 2023
1 parent 977c948 commit 6201f0e
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ plugins:

theme: minima

comments:
provider: giscus

giscus:
repo: "cwecht/optionalcpp "
repo-id: "R_kgDOGdxr4A"
category: "General"
category-id: "DIC_kwDOGdxr4M4Cas3R"
mapping: "title"
reaction-enabled: "1"
theme: "noborder_light"
crossorigin: "anonymous"
lang: "en"

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
Expand Down
48 changes: 48 additions & 0 deletions docs/_includes/comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% assign provider = site.comments.provider | default:"giscus" %}
{% if provider == "disqus" %}
{% assign disqus = site.disqus | default:site.disqus_shortname %}
{% if disqus %}
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '{{ page.url | absolute_url }}';
this.page.identifier = '{{ page.url | absolute_url }}';
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
{% endif %}
{% elsif provider == "utterances" %}
{% assign utterances = site.utterances %}
{% if utterances.repo %}
<script src="https://utteranc.es/client.js"
repo={{ utterances.repo }}
issue-term={{ utterances.issue-term }}
label={{ utterances.label }}
theme={{ utterances.theme }}
crossorigin= "anonymous"
async>
</script>
{% endif %}
{% elsif provider == "giscus" %}
{% assign giscus = site.giscus %}
{% if giscus.repo %}
<script src="https://giscus.app/client.js"
data-repo={{ giscus.repo }}
data-repo-id={{ giscus.repo-id }}
data-category={{ giscus.category }}
data-category-id={{ giscus.category-id }}
data-mapping={{ giscus.mapping }}
data-reactions-enabled={{ giscus.reaction-enabled }}
data-theme={{ giscus.theme }}
crossorigin={{ giscus.crossorigin }}
data-lang={{ giscus.lang }}
async>
</script>
{% endif %}
{% endif %}
20 changes: 20 additions & 0 deletions docs/_layouts/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">

{%- include head.html -%}

<body>

{%- include header.html -%}

<main class="page-content" aria-label="Content">
<div class="wrapper">
{{ content }}
</div>
</main>

{%- include footer.html -%}

</body>

</html>
14 changes: 14 additions & 0 deletions docs/_layouts/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: default
---
<article class="post">

<header class="post-header">
<h1 class="post-title">{{ page.title | escape }}</h1>
</header>

<div class="post-content">
{{ content }}
</div>

</article>

0 comments on commit 6201f0e

Please sign in to comment.