next-theme / hexo-next-giscus

Giscus comment system for NexT
MIT License
23 stars 3 forks source link

add STRICT option #12

Closed flashlab closed 6 months ago

flashlab commented 6 months ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch hexo-next-giscus@1.2.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/hexo-next-giscus/default.yaml b/node_modules/hexo-next-giscus/default.yaml
index 9cc1267..29721c5 100644
--- a/node_modules/hexo-next-giscus/default.yaml
+++ b/node_modules/hexo-next-giscus/default.yaml
@@ -8,8 +8,10 @@ giscus:
   # Available values: pathname | url | title | og:title
   mapping: pathname
   # Available values: 0 | 1
+  strict: 0
+  # Available values: 0 | 1 
   reactions_enabled: 1
-   # Available values: 0 | 1 
+  # Available values: 0 | 1 
   emit_metadata: 1
   # Available values: light | dark | dark_high_contrast | transparent_dark | preferred-color-scheme
   theme: light
diff --git a/node_modules/hexo-next-giscus/giscus.njk b/node_modules/hexo-next-giscus/giscus.njk
index cae2369..0e24615 100644
--- a/node_modules/hexo-next-giscus/giscus.njk
+++ b/node_modules/hexo-next-giscus/giscus.njk
@@ -14,6 +14,7 @@ document.addEventListener('page:loaded', () => {
         'data-category'         : CONFIG.giscus.category,
         'data-category-id'      : CONFIG.giscus.category_id,
         'data-mapping'          : CONFIG.giscus.mapping,
+        'data-strict'           : CONFIG.giscus.strict,
         'data-reactions-enabled': CONFIG.giscus.reactions_enabled,
         'data-emit-metadata'    : CONFIG.giscus.emit_metadata,
         'data-theme'            : CONFIG.giscus.theme,

This issue body was partially generated by patch-package.

stevenjoezhang commented 6 months ago

Thanks for your suggestion, version 1.3.0 released: https://github.com/next-theme/hexo-next-giscus/commit/ee9321d4a2f454150804bfc85e1ba148231f19d5