Skip to content

Commit

Permalink
Merge pull request #37 from ndy2/36-add-comment-with-giscus
Browse files Browse the repository at this point in the history
add comment with giscus
  • Loading branch information
ndy2 authored Mar 7, 2024
2 parents c320cab + 6dbc7bd commit 695afda
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 1 deletion.
48 changes: 48 additions & 0 deletions docs/assets/overrides/partials/comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% if page.meta.comments %}
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
<!-- Insert generated snippet here -->
<script src="https://giscus.app/client.js"
data-repo="ndy2/mkdocs-obsidian-support-plugin"
data-repo-id="R_kgDOI_-dog"
data-category="General"
data-category-id="DIC_kwDOI_-dos4Cdy6r"
data-mapping="pathname"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="bottom"
data-theme="preferred_color_scheme"
data-lang="ko"
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" ? "dark" : "light"
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" ? "dark" : "light"

/* Instruct Giscus to change theme */
var frame = document.querySelector(".giscus-frame")
frame.contentWindow.postMessage(
{giscus: {setConfig: {theme}}},
"https://giscus.app"
)
}
})
})
</script>
{% endif %}
1 change: 1 addition & 0 deletions docs/features/admonition/backquotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Admonition Backquotes
comments: true
---
> [!note] feature - admonition backquotes
> convert `block-styled admonition` to `mkdocs-material admonition`
Expand Down
1 change: 1 addition & 0 deletions docs/features/admonition/callout.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Admonition Callout
comments: true
---
> [!note] feature - admonition callout
> Convert `obsidian callout` to `mkdocs-material admonition`
Expand Down
4 changes: 4 additions & 0 deletions docs/features/admonition/demo.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Demo
comments: true
---
## Examples

`1. basic`
Expand Down
1 change: 1 addition & 0 deletions docs/features/comment/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Comment
comments: true
---

> [!note] feature - comment
Expand Down
1 change: 1 addition & 0 deletions docs/features/image-link/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Image-Link
comments: true
---
> [!note] feature - image-link
> Convert `obsidian wikilink for images` to `mkdocs-material md-link for images`
Expand Down
5 changes: 4 additions & 1 deletion docs/features/pdf/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

---
title: Pdf
comments: true
---
> [!note] feature - image-link
> Convert `obsidian embed pdf` to `html embed pdf`
>
Expand Down
4 changes: 4 additions & 0 deletions docs/features/tabs/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Tabs
comments: true
---
> [!note] feature - tags
> Convert `obsidian html-tabs` to `mkdocs-material content tab`
>
Expand Down
1 change: 1 addition & 0 deletions docs/features/tags/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Tags
comments: true
---
> [!note] feature - tags
> Convert `obsidian tags` to `mkdocs-material search`
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: README
comments: true
---

Plugin for [mkdocs-material](https://squidfunk.github.io/mkdocs-material/) to convert semantic in documentation
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ theme:
font:
text: Roboto
code: Roboto Mono
custom_dir: docs/assets/overrides
features:
- content.code.copy
- content.action.view
Expand Down

0 comments on commit 695afda

Please sign in to comment.