plugin updated for NodeBB v1.x.x
[nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget)
-
@phenomlab I see.... I have a couple things I think may warrant further exploration but am busy w/else at present and not gone beyond perfunctory examination. Sigh...
But it is on my list!!
-
I decided to install a fresh copy of ghost and NodeBB to see what's up.
The plugin does technically work, but you need to use the script in the README/git and not the one on this page which is outdated.
Correct script:
<a id="nodebb-comments"></a> <script type="text/javascript"> var nbb = {}; nbb.url = '//your.nodebb.com'; // EDIT THIS nbb.cid = 1; // OPTIONAL. Forces a Category ID in NodeBB. // Omit it to fallback to specified IDs in the admin panel. (function() { nbb.articleID = '{{../post.id}}'; 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-title" type="text/markdown">{{../post.title}}</script> <script id="nbb-markdown" type="text/markdown">{{../post.markdown}}</script> <noscript>Please enable JavaScript to view comments</noscript>
After that, commenting it works great.
HOWEVER, the bigger issue is, ghost no longer uses Markdown, but HTML. So the article content doesn't show up on NodeBB.
You can change the script to use
{{../post.content}}
in place of{{../post.markdown}}
to feed the HTML to NodeBB, but you will also need to turn Allow HTML on in the Markdown plugin.Then it works.
-
@yariplus Good to know! Thx for this.
I presume Ghost is already sanitizing the html comment input so safe to pass thru to nodebb?
-
@gotwf Good point. They are sanitized on the NodeBB side, so whatever sanitize plugin you use should account for anyone trying to put something sneaky into your ghost.
-
I just tried injecting some stuff, and it looks like it stopped everything unnormal out of the box.
-
@yariplus Thanks for looking into this! I'll admit that yes, blog-comments doesn't get enough love
Let's chat offline about this, but by-and-large, checking "Allow HTML" in the Markdown plugin wouldn't be ideal, since that enables HTML across the board for ALL categories and ALL users, which I think is dangerous
There may be a way for NodeBB to take the input and insert HTML into the database, let's chat offline.
-
@phenomlab I forked our posts to a new topic.
-
Hi all, I have updated OP with the latest readme content, so it has the proper WP snippet now, at least.
-
@julian Thanks. Has the ghost snippet been changed also? The one included in the original post seems to be incorrect, but works if you use the snippet from Github
-
@phenomlab yes, I replaced the entire contents of OP with the latest readme
-
-
@kurulumu-net Did you
./nodebb build
? That might help fix things. -
@julian @baris I can confirm that I now experience the same issue as @kurulumu-Net since upgrading to the latest version of this plugin
-
Thanks for reporting should be fixed in 0.8.3
-
@baris thanks. Will check shortly
-
This post is deleted! -
@baris @julian does this plugin still work on NodeBB 1.19.3 ? I've not published an article for some time (last one was before the 1.19.3 upgrade which worked fine). I now get
No publish to NodeBB button, and certainly no comments
Any ideas ? All previously created posts seem to work fine. As a test, I created a new text only simple post, and that does not work either - same issue.
-
-
@phenomlab yes, it should still work, we still use it for our blog, which is on WordPress now (as of late last year)
What version of the plugin?
-
@julian Latest version available.