-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Enable comments and reactions on blog posts #41
Enable comments and reactions on blog posts #41
Conversation
896ae49
to
eed90ec
Compare
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.
We need to solve the issue with useBlogPost
. And please remove the merge commit and rebase instead. As a rule of thumb, you should hardly ever have merge commits in your PRs.
blog/2024-03-04-on-implementation-of-distributed-prtocols/index.mdx
Outdated
Show resolved
Hide resolved
Please continue working in this PR. Just force-push into it. |
ecab735
to
4948425
Compare
4948425
to
58927fa
Compare
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.
Please don't add draft
field to the front matter of the existing posts. Also, revert other unintended changes. (It's always good to have a look at the changes before requesting review.)
There's also a problem when switching between dark and light themes, but Disqus renders correctly after reloading the page. I guess we should just tolerate this. |
I think we can use useEffect to solve this issue |
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.
Great that you found a solution for the issue with switching dark/light mode!
Please try to always check what commits you push and have a look what the changes look like. Now there are two commits in this PR that should be squashed together.
2495995
to
9f9f5f4
Compare
Signed-off-by: Shivank Anchal <[email protected]>
5c5cbf4
to
f123f98
Compare
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.
Please remove the merge commit and rebase instead. As a rule of thumb, you should hardly ever have merge commits in your PRs.
@@ -6,7 +6,7 @@ export default function CopyrightWrapper(props) { | |||
const { siteConfig: { customFields: { | |||
siteLicense, | |||
} } } = useDocusaurusContext(); | |||
|
|||
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.
Now there is a trailing whitespace...
const { metadata } = useBlogPost(); | ||
const { frontMatter, permalink, title } = metadata; | ||
const currentUrlOrigin = typeof window !== 'undefined' ? window.location.origin : ''; | ||
const fullPermalink = `${currentUrlOrigin}${permalink}`; |
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.
I believe we should use ${siteConfig.url}
instead of ${currentUrlOrigin}
here (see this).
colorMode={disqusColorMode} | ||
shortname={shortname} | ||
config={{ | ||
url: fullPermalink, |
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.
Hmm, I thought metadata.permalink
is the full URL. Now I see it doesn't include the base URL. Then I think we can use it as the discussion identifier and add identifier: permalink
.
{comments && ( | ||
<DiscussionEmbed | ||
// This property is not used by `DiscussionEmbed`, but forces React to re-render it upon theme changes | ||
colorMode={disqusColorMode} |
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.
React complains about this property's name:
React does not recognize the `colorMode` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `colormode` instead.
Let's make it happy by using colormode
instead.
Blog post pages now throw "Uncaught runtime errors" in development mode:
The errors disappear when removing Disqus' |
No description provided.