Skip to content

Conversation

@Lumysia
Copy link

@Lumysia Lumysia commented Oct 3, 2025

The theme's JavaScript did not read or apply the strict parameter from the site config, preventing the use of Giscus's strict mapping feature.

On multilingual sites using pathname mapping, this default fuzzy matching could cause incorrect discussion mapping. For example, a page at /about/ could incorrectly load the discussion for a page at /zh-cn/about/.

This commit resolves the issue by:

  1. Ensuring the strict parameter is passed from the Hugo template (comment.html) to the global config object.
  2. Updating theme.js to read this strict value and set the data-strict attribute on the dynamically generated Giscus script tag.

This allows users to enable exact matching by setting strict = "1" in their config, fixing the multilingual comment issue.

The theme's JavaScript did not read or apply the `strict` parameter from the site config, preventing the use of Giscus's strict mapping feature.

On multilingual sites using `pathname` mapping, this default fuzzy matching could cause incorrect discussion mapping. For example, a page at `/about/` could incorrectly load the discussion for a page at `/zh-cn/about/`.

This commit resolves the issue by:
1.  Ensuring the `strict` parameter is passed from the Hugo template (`comment.html`) to the global config object.
2.  Updating `theme.js` to read this `strict` value and set the `data-strict` attribute on the dynamically generated Giscus script tag.

This allows users to enable exact matching by setting `strict = "1"` in their config, fixing the multilingual comment issue.
@netlify
Copy link

netlify bot commented Oct 3, 2025

Deploy Preview for hugo-loveit ready!

Name Link
🔨 Latest commit cf1a45e
🔍 Latest deploy log https://app.netlify.com/projects/hugo-loveit/deploys/68e046a387c4cb00085647b3
😎 Deploy Preview https://deploy-preview-999--hugo-loveit.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99
Accessibility: 98
Best Practices: 100
SEO: 82
PWA: 78
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant