Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add giscus comments system #448

Merged
merged 3 commits into from
Apr 29, 2023
Merged

Conversation

xjasonlyu
Copy link
Contributor

@xjasonlyu xjasonlyu commented Apr 19, 2023

Description

Adding the support for Giscus Comments System, a comments system powered by GitHub Discussions.

Giscus was heavily inspired by utterances, but with more config options and a better UI.

Issue Number:

Feature Request for #446


Additional Information (Optional)

Example/configuration can be found and generated at giscus.

<script src="https://giscus.app/client.js"
        data-repo="[ENTER REPO HERE]"
        data-repo-id="[ENTER REPO ID HERE]"
        data-category="[ENTER CATEGORY NAME HERE]"
        data-category-id="[ENTER CATEGORY ID HERE]"
        data-mapping="pathname"
        data-strict="0"
        data-reactions-enabled="1"
        data-emit-metadata="0"
        data-input-position="bottom"
        data-theme="light"
        data-lang="en"
        crossorigin="anonymous"
        async>
</script>

Demo with Giscus

Light mode:

Screenshot 2023-04-19 at 4 21 32 PM

Dark mode:

Screenshot 2023-04-19 at 4 21 47 PM


Checklist

Yes, I included all necessary artefacts, including:

  • Tests
  • Documentation
  • Implementation (Code and Ressources)
  • Example

Testing Checklist

Yes, I ensured that all of the following scenarios were tested:

  • Desktop Light Mode (Default)
  • Desktop Dark Mode
  • Desktop Light RTL Mode
  • Desktop Dark RTL Mode
  • Mobile Light Mode
  • Mobile Dark Mode
  • Mobile Light RTL Mode
  • Mobile Dark RTL Mode

the giscus theme changes when the theme changes


Notify the following users

@netlify
Copy link

netlify bot commented Apr 19, 2023

Deploy Preview for anatole-demo ready!

Name Link
🔨 Latest commit ab2cc72
🔍 Latest deploy log https://app.netlify.com/sites/anatole-demo/deploys/64479cca49841000089dbe42
😎 Deploy Preview https://deploy-preview-448--anatole-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Owner

@lxndrblz lxndrblz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xjasonlyu LGTM. Thanks for your PR.

@lxndrblz
Copy link
Owner

@xjasonlyu Would you mind adding a sample configuration as a coment that I could add to the wiki?

Thanks.

@xjasonlyu
Copy link
Contributor Author

xjasonlyu commented Apr 23, 2023

Yes, sure thing!

Adding Giscus

First generate the config according to the official document, and then enter those params in the config.toml:

[params.giscus]
repo = "githubuser/reponame"
repoID = "Github Repo ID"
category = "Discussions Category"
categoryID = "Discussions Category ID"
# <Optional Params>
# mapping = "pathname"
# strict = "0"
# reactionsEnabled = "1"
# emitMetadata = "0"
# inputPosition = "bottom"
# lang = "en"
# loading = "lazy"

@sonarcloud
Copy link

sonarcloud bot commented Apr 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@lxndrblz lxndrblz self-assigned this Apr 29, 2023
@lxndrblz lxndrblz added the enhancement New feature or request label Apr 29, 2023
@lxndrblz lxndrblz linked an issue Apr 29, 2023 that may be closed by this pull request
@lxndrblz lxndrblz merged commit bedc8f5 into lxndrblz:master Apr 29, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding giscus for new comment system support
2 participants