Skip to content

Commit

Permalink
check the commenting system
Browse files Browse the repository at this point in the history
  • Loading branch information
DininduSenanayake committed Jul 30, 2024
1 parent 8a0372e commit 9719367
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/Supplementary/1-supplementary.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
comments: true
---

# 1. Supplementary - File manipulation

## File manipulation and more practice with pipes
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repo_url: https://github.com/GenomicsAotearoa/introduction-to-shell

theme:
name: material
custom_dir: overrides
logo: fig/nesi_ga.png
favicon: fig/nesi_ga.png
# 404 page
Expand Down
54 changes: 54 additions & 0 deletions overrides/partials/comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% if page.meta.comments %}
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
<script src="https://giscus.app/client.js"
data-repo="GenomicsAotearoa/introduction-to-shell"
data-repo-id="R_kgDOMbvivA"
data-category="Q&A"
data-category-id="DIC_kwDOMbvivM4ChQ-7"
data-mapping="og:title"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="dark"
data-lang="en"
crossorigin="anonymous"
async>
</script>

<!-- Synchronize Giscus theme with palette -->
<script>
var giscus = document.querySelector("script[src*=giscus]")

// Set palette on initial load
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object") {
var theme = palette.color.scheme === "slate"
? "transparent_dark"
: "light"

// Instruct Giscus to set theme
giscus.setAttribute("data-theme", theme)
}

// Register event handlers after documented loaded
document.addEventListener("DOMContentLoaded", function() {
var ref = document.querySelector("[data-md-component=palette]")
ref.addEventListener("change", function() {
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object") {
var theme = palette.color.scheme === "slate"
? "transparent_dark"
: "light"

// Instruct Giscus to change theme
var frame = document.querySelector(".giscus-frame")
frame.contentWindow.postMessage(
{ giscus: { setConfig: { theme } } },
"https://giscus.app"
)
}
})
})
</script>
{% endif %}

0 comments on commit 9719367

Please sign in to comment.