add disqus as an opt-in plugin for theme users#45
add disqus as an opt-in plugin for theme users#45panzerstadt wants to merge 2 commits intoPitayan:masterfrom
Conversation
|
I think the functionalities itself is great. Here are some feedbacks regarding the styles an so on.
|
done! 927fb3e
hmm does gatsby have its own way to do it? (to avoid adding another library and rolling our own) i looked at gatsby's lazy loading recommendations and found this, but its mainly about loading it after the critical path. here's the commit of changes for lazy loaded disqus (using react.lazy, as the official recommended plugin does not support gatsby v5 / react 18 before: (loads together with other components, before page data) after: (loads after page data has been loaded) if you're looking for loading in-view (e.g. with intersection observer, i can recommend this one https://www.npmjs.com/package/react-hook-inview). if you're ok with either/both just tell me and i'll add them in!
|


fixes #32
because i didn't seem to see any existing methods to turn on optional features, i've opted to use environment variables to opt into using disqus.
steps to use:
note that the disqus comments are linked to your current url, so localhost:8000/post/xxx would have all your development comments, while production should have its own. this way you get to play around with disqus without messing with prod.