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

Implement Disqus plugin #1449

Merged
merged 14 commits into from
Jan 24, 2021
Merged

Implement Disqus plugin #1449

merged 14 commits into from
Jan 24, 2021

Conversation

wxwxwxwx9
Copy link
Contributor

@wxwxwxwx9 wxwxwxwx9 commented Jan 16, 2021

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • Others, please explain:

This PR resolves #481.

Overview of changes:
Setup Disqus plugin with lazy loading using IntersectionObserver API.

Anything you'd like to highlight / discuss:

  • Code quality / implementation
  • Documentation (whether the explanation is clear enough)

Testing instructions:
Add <disqus/> to any page and markbind serve.

You should be able to see the disqus comments section (it should load only when you scroll near it).

Proposed commit message: (wrap lines at 72 characters)
Implement Disqus plugin.

Users may want to allow readers to comment on content in the website.
This can be an important feature for educational websites as it enables
better student interaction.

Let's integrate Disqus into MarkBind to enable this commenting feature.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No blatantly unrelated changes
  • Pinged someone for a review!

@wxwxwxwx9
Copy link
Contributor Author

@ang-zeyu Hi Zeyu, this PR is ready for your review :-) if everything looks fine, I will proceed to update the test.

packages/core/src/plugins/disqus.js Outdated Show resolved Hide resolved
packages/core/src/plugins/disqus.js Outdated Show resolved Hide resolved
docs/userGuide/plugins/googleAnalytics.mbdf Outdated Show resolved Hide resolved
docs/userGuide/plugins/disqus.mbdf Outdated Show resolved Hide resolved
@wxwxwxwx9
Copy link
Contributor Author

@ang-zeyu The PR is ready for your review :-). I've made the changes you suggested. I've also ensured that the redirecting of the path are handled accordingly. Although i'm not sure if there might be any edge cases that I missed out (hopefully not).

Copy link
Contributor

@ang-zeyu ang-zeyu left a comment

Choose a reason for hiding this comment

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

Couple of nits and one issue / clarification:

packages/core/src/plugins/disqus.js Outdated Show resolved Hide resolved
docs/userGuide/plugins/disqus.mbdf Outdated Show resolved Hide resolved
docs/userGuide/plugins/disqus.mbdf Outdated Show resolved Hide resolved
docs/userGuide/tweakingThePageStructure.md Outdated Show resolved Hide resolved
docs/userGuide/plugins/disqus.mbdf Outdated Show resolved Hide resolved
docs/site.json Outdated Show resolved Hide resolved
docs/userGuide/plugins/disqus.mbdf Outdated Show resolved Hide resolved

<box type="tip">

It may be a good idea to create a [layout]({{ baseUrl }}/userGuide/tweakingThePageStructure.html#layouts) with `<disqus/>` in it, so that you won't have to repeat it on every page.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

{{ baseUrl }}/userGuide/tweakingThePageStructure.html#layouts

I specified it as .html currently as our .md to .html conversion currently can't handle links with #.

I will make a PR to update the implementation and change this to .md afterwards :-)

Copy link
Contributor

@ang-zeyu ang-zeyu left a comment

Choose a reason for hiding this comment

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

Lgtm!

@ang-zeyu ang-zeyu merged commit 49fb1f9 into MarkBind:master Jan 24, 2021
@ang-zeyu ang-zeyu added this to the v3.0 milestone Jan 24, 2021
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.

Support disqus
3 participants