[nodebb-plugin-blog-comments] Need help
-
GitHub - psychobunny/nodebb-plugin-blog-comments: Lets NodeBB act as a comments engine/widget for your blog
Lets NodeBB act as a comments engine/widget for your blog - psychobunny/nodebb-plugin-blog-comments
GitHub (github.com)
Work fine
-
@The-Worms said:
GitHub - psychobunny/nodebb-plugin-blog-comments: Lets NodeBB act as a comments engine/widget for your blog
Lets NodeBB act as a comments engine/widget for your blog - psychobunny/nodebb-plugin-blog-comments
GitHub (github.com)
Work fine
Yes, thatβs the official one, and it's working with Ghost 1.x for me as well.
This blog comments plugin is used on the official blog.nodebb.org
See also on this forum: [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget) | NodeBB
-
Ok i have again installed
npm install nodebb-plugin-blog-comments
In NodeBB
In post.hbs
{{!-- Everything inside the #post tags pulls data from the post --}} {{#post}} <a id="nodebb/comments"></a> <script type="text/javascript"> var nbb = {}; nbb.url = '//forum.frank-mankel.org'; // EDIT THIS (function() { nbb.articleID = '{{../post.id}}'; nbb.title = '{{../post.title}}'; nbb.tags = [{{#../post.tags}}"{{name}}",{{/../post.tags}}]; nbb.script = document.createElement('script'); nbb.script.type = 'text/javascript'; nbb.script.async = true; nbb.script.src = nbb.url + '/plugins/nodebb-plugin-blog-comments/lib/ghost.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(nbb.script); })(); </script> <script id="nbb-markdown" type="text/markdown">{{{../post.markdown}}}</script> <noscript>Please enable JavaScript to view comments</noscript>
Some Errors
ghost.js:15 Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null at ghost.js:15 at ghost.js:344 document.getElementById('nodebb-comments').insertAdjacentHTML('beforebegin', '<div id="nodebb"></div>');
I don't have an "publishing button" !?
And now away from Keyboard
-
Just change this :
nbb.url = '//your.nodebb.com'; // EDIT THIS nbb.cid = 1; // OPTIONAL. Forces a Category ID in NodeBB.
your code post.hbs :
<a id="nodebb-comments"></a> <script type="text/javascript"> var nbb = {}; nbb.url = '//forum.frank-mankel.org'; // EDIT THIS nbb.cid = 14; // OPTIONAL. Forces a Category ID in NodeBB. // Omit it to fallback to specified IDs in the admin panel. (function() { nbb.articleID = '{{../post.id}}'; nbb.title = '{{../post.title}}'; nbb.tags = [{{#../post.tags}}"{{name}}",{{/../post.tags}}]; nbb.script = document.createElement('script'); nbb.script.type = 'text/javascript'; nbb.script.async = true; nbb.script.src = nbb.url + '/plugins/nodebb-plugin-blog-comments/lib/ghost.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(nbb.script); })(); </script> <script id="nbb-markdown" type="text/markdown">{{../post.markdown}}</script> <noscript>Please enable JavaScript to view comments</noscript>
search :
{{!-- If you use Disqus comments, just uncomment this block. The only thing you need to change is "test-apkdzgmqhj" - which should be replaced with your own Disqus site-id. <section class="post-full-comments"> <div id="disqus_thread"></div> <script> var disqus_config = function () { this.page.url = '{{url absolute="true"}}'; this.page.identifier = 'ghost-{{comment_id}}'; }; (function() { var d = document, s = d.createElement('script'); s.src = 'https://test-apkdzgmqhj.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> </section> --}}
Delete and replace for your code
-
First, thank you @The-Worms !
But nothing works. I give up, for today
I got an TypeError
document.getElementById('nodebb-comments').insertAdjacentHTML('beforebegin', '<div id="nodebb"></div>');
NodeBB Forum https://forum.frank-mankel.org/
Blog https://frank-mankel.org -
search :
{{!-- If you use Disqus comments, just uncomment this block. The only thing you need to change is "test-apkdzgmqhj" - which should be replaced with your own Disqus site-id. <section class="post-full-comments"> <div id="disqus_thread"></div> <script> var disqus_config = function () { this.page.url = '{{url absolute="true"}}'; this.page.identifier = 'ghost-{{comment_id}}'; }; (function() { var d = document, s = d.createElement('script'); s.src = 'https://test-apkdzgmqhj.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> </section> --}}
Replace with
{{!-- Discuss Comment Integration --}} <section class="post-full-comments"> <a id="nodebb-comments"></a> <script type="text/javascript"> var nbb = {}; nbb.url = '//forum.frank-mankel.org'; // EDIT THIS nbb.cid = 14; // OPTIONAL. Forces a Category ID in NodeBB. // Omit it to fallback to specified IDs in the admin panel. (function() { nbb.articleID = '{{../post.id}}'; nbb.title = '{{../post.title}}'; nbb.tags = [{{#../post.tags}}"{{name}}",{{/../post.tags}}]; nbb.script = document.createElement('script'); nbb.script.type = 'text/javascript'; nbb.script.async = true; nbb.script.src = nbb.url + '/plugins/nodebb-plugin-blog-comments/lib/ghost.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(nbb.script); })(); </script> <script id="nbb-markdown" type="text/markdown">{{../post.markdown}}</script> <noscript>Please enable JavaScript to view comments</noscript> </section> <!-- nodebb Comment End -->
-
I don't know why, but after an reinstall from ghost it works.
I do what @The-Worms posted. And, that works@The-Worms Thank you!