-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support Cusdis in nextra-theme-blog #143
Conversation
This pull request is being automatically deployed with Vercel (learn more). nextra – ./🔍 Inspect: https://vercel.com/shuding/nextra/AQFsD98a2SjtVN9WNzQfW496CBnt [Deployment for b456f27 failed] nextra-dev – ./examples/docs🔍 Inspect: https://vercel.com/shuding/nextra-dev/3pzuBepqMTdEgAvEUnmE6pzHYQzp |
@@ -13,13 +13,17 @@ import getTitle from './utils/get-title' | |||
import getTags from './utils/get-tags' | |||
import sortDate from './utils/sort-date' | |||
|
|||
// comments | |||
import { ReactCusdis } from 'react-cusdis' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { ReactCusdis } from 'react-cusdis' | |
import dynamic from 'next/dynamic' | |
const ReactCusdis = dynamic( | |
() => import('react-cusdis').then((mod) => mod.ReactCusdis), | |
{ ssr: false } | |
) |
With dynamic import, the module won't be included in the bundle if the cusdis
option is not enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
@djyde I would suggest also adding docs on nextra.vercel.app describing the exciting feature! |
Done |
@djyde It seems there is a check failing |
@shuding When will this PR get released? Thanks! |
I add a
comments
props inLayout
, so if we want to add another comment widget, we can just pass differentcomments
component to theLayout
Usage:
In
theme.config.js
:Preview: