[nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget)
-
@psychobunny thank you! As always, much appreciated.
-
Trying to get this working, having some success.
Problems I discovered:
-
Some replies silently fail. The problem was I was entering posts that are too short for nodebb's minimum post length setting. Workaround: reduce this size in nodebb settings.
-
BUG: I am testing on page (see below) with no content, and no excerpt, and the javascript blows up on translator.firstChild.innerHTML when the excerpt is empty, because there is no firstChild.
One limitation I discovered:
- Page support: I am trying to use comments on pages (not posts), and I am getting an "Unable to access API. Please install the JSON API" in my browser console, but it is installed. If I try swapping ?json=get_post&post_id=118 for ?json=get_page&page_id=118 in a manual browser request, it works. But I see public/lib/wordpress.js only uses get_post. How hard would this feature be to add?
- Ok I started taking a shot at it by using the implicit mode on the API: ?json=118. Then instead of making articleData *.post in wordpress.js, take .page if post is null.
- This seems to work, except then I get redirected to https://example.com/my-page-slug/#nodebb/comments -- not sure what's going on here.
-
-
@jaredthirsk said:
- This seems to work, except then I get redirected to https://example.com/my-page-slug/#nodebb/comments -- not sure what's going on here.
Ok, I feel a bit silly: it was just scrolling down to an area that was all white, because I had my comment input below the comments, and the nodebb/comments element is after this (BUG! I think nodebb/comments should be above where the comments start, no matter how the comment box setting is set. But I will probably set that setting back because the ordering is reverse and I don't know how to change that (Limitation). Edit: I changed it but it still seems to be scrolling really low, making the user think that the page is blank. This doesn't seem good!)
-
Does this plugin works with the latest version of nodebb? After I have upgraded the nodebb to 1.1.0 I can no longer see the comments on my blog. However they are still there in the nodebb.
-
Yes, it's working on this site: https://blog.nodebb.org/nodebb-v1-1-0-release/
AFAIK no hooks or anything related to publishing and commenting have changed since the last minor version
-
@psychobunny Interesting. Any idea why suddenly after updating the nodebb all the comments from my ghost ware gone? I mean on the Ghost site cause I can still see them in the nodebb.
-
@psychobunny said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
anything related to publishing and commenting have changed since the
Any suggestion on how to debug it to eventually make it show up on the ghost posts?
-
Can I have any help on making this working again? I have done everything what it is in the documentation and it's not working since I have upgraded to v1.1.0 and I had to add
proxy_set_header X-Forwarded-Proto $scheme;
to the nginx. ` -
Any errors in the browser console?
-
@psychobunny said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
Any errors in the browser console?
No errors only this warning:
6/8 19:11 [19025] - warn: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.
- nodebb-plugin-blog-comments
-
Here is my posts.hbs related to this plugin on the ghost side:
74 <a id="nodebb/comments"></a> 75 <script type="text/javascript"> 76 var nbb = {}; 77 nbb.url = 'z0z0.me/comments'; // EDIT THIS 78 79 (function() { 80 nbb.articleID = '{{../post.id}}'; nbb.title = '{{../post.title}}'; 81 nbb.tags = [{{#../post.tags}}"{{name}}",{{/../post.tags}}]; 82 nbb.script = document.createElement('script'); nbb.script.type = 'text/javascript'; nbb.script.async = true; 83 nbb.script.src = nbb.url + '/plugins/nodebb-plugin-blog-comments/lib/ghost.js'; 84 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(nbb.script); 85 })(); 86 </script> 87 <script id="nbb-markdown" type="text/markdown">{{{../post.markdown}}}</script> 88 <noscript>Please enable JavaScript to view comments</noscript>
and here is the nginx config related to this:
location ^~ /comments { proxy_set_header X-Real_IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Nginx_Proxy true; proxy_pass http://comments_upstream; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
-
This line
nbb.url = 'z0z0.me/comments';
Make it
nbb.url = '//z0z0.me/comments';
I have no idea how this would have worked for you prior to the upgrade, unless you modified this line while trying to debug your code. This ought to fix it though.
-
@psychobunny said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):
I have no idea how this would have worked for you prior to the upgrade, unless you modified this line while trying to debug your code. This ought to fix it though.
Actually this line was
nbb.url = 'https://z0z0.me/comments';
-
Yeah, that should work too. Any luck?
-
Did the change but no luck at all.
Here the comments should show up.
-
Aha. Change
<a id="nodebb/comments"></a>
to
<a id="nodebb-comments"></a>
For posterity, see
ghost.js
in this PR: https://github.com/psychobunny/nodebb-plugin-blog-comments/pull/52/files