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
(post comments) GitHub hosted comments for GitHub hosted blogs #12
Comments
This is pretty great, I think I'll write it up on the GitHub blog! |
Amazing! Here's an issue for ya: justification on your article text! Scroll through your article again to see where it bites nastily |
Thanks, Tom and Mislav! I love that GitHub is so hackable that pulling this off was quite easy -- keep it up! |
Whoa... the new GitHub API (v3) is awesome! The Issues API directly supports fetching the HTML rendering of a comment's Markdown source so there's no need to do that rendering manually on the client side (using the Showdown lib)! I've updated the post to highlight this awesomeness :) |
Just as a heads-up, this seems to have broken at some point… each comment body only shows up as “undefined” when I read the blog post page. |
Thanks -- looks like it got broken as a result of a Comments v3 API bug, which I just reported http://support.github.com/discussions/api/365-comments-api-v3-broken-not-returning-comment-bodies. |
This is great. I only wish it was possible to leave anonymous comments too... Requiring github account is waaay too geeky for most people out there (admit it, we are a minority here). |
I really like this idea but can we take it to the next level? Would it be possible to render a comment form at the end of the page along with a captcha? Would it be possible to have a captcha web service that makes the submit comment on your behalf? This way you can still keep your blog as a client side app with no backend. It would be all that hard to write such a web service and host it on cloud foundry. |
@Pyrolistical -- that's a cool ided! And you're right, it wouldn't be hard to write such a web service. However, that still introduces another component into the picture which someone has to maintain, because if it goes down - "no commenting for you"! Also, you could still bypass the captcha by going directly to the github issues page and commenting there. In general, I tend to think that captchas are not needed because the commenting system is tied to GitHub and only GitHub account holders can comment. Therefore, if someone starts spamming GitHub issue pages - you can be sure that the GitHub crew will do a much better job of chasing such accounts down and stopping them than any captcha system. |
@ppanyukov Sorry for not answering before. You're right -- anonymous comments would be cool. But using OpenID to login into GitHub would be even cooler. Until then, people will just have to learn to love GitHub :) |
Hi @izuzak! I've played around with your pretty cool commenting system. I changed it to get HTML from issue tracker. The only thing unclear for me: does my hack work with some versions of Chrome. Please look at
I don't intend to keep these files always, so don't forget to copy files you need. I think the further step for commenting system is to make a commenting form on post's page. For instanse, preview can be done with GFM JavaScript (maybe the preview is not necessary). After comment is sent, it can be edit from post's page using a JSON request. However, this requires user authentication on post's page. Yes, GitHub allows to do this task as well, but I see huge code size should be made. |
Hi @visconte! :) That's very cool, thanks for finding the time to work on that and write up a comment! It took me a while to understand what you actually mean by "get HTML from issue tracker" i.e. that you mean directly getting the comments in HTML format without calling the showdown markdown converter. As it turns out, your solution only partially solves the problem. Furthermore, the "jquery.xdomainajax.js" you are using is useless as it is not being used at all when you make your First, why was there a problem with fetching issue comments in HTML? The GitHub API does enable setting the desired mime type (e.g. Second, why does your solution work? The Request
Response
Notice the Third, and most important, why is your solution not general enough? Your solution works because your blog is hosted on a github subdomain ( How did I solve the problem? Well, notice that the GitHub API documentation on CORS says that you can extend the list of domains which the GitHub CORS allows for cross-origin requests, by registering your site as an OAuth application. Therefore, everything that needs to be done for sites that use custom domains is to register the site as an OAuth application for using the API. This is what I've done and now I can make cross origin request from I'll update my blog post to include a more detailed description of this process. Let me know if this wasn't clear enough :). Also -- your solution has nothing to do with browsers (or at least - it shouldn't). It should either work in all browsers, or not work in any browser. |
Thank you for the answer! You are right, |
Ah, you're right and I was wrong! Thanks! GitHub doesn't enable CORS by default for I guess we both came to the same conclusion, after all :) |
Have a test! |
brilliant |
awesome |
((Not exactly what I need. And yet,)) |
Do you have an automated way of creating the post issues, or do you do it by hand each time? The latter seems like a bit of a pain. |
@MarkLodato See "Create an issue" at http://developer.github.com/v3/issues/ Also, pull requests are just branches in a separate ref space - you may also check if a non pull request issue might be accessible this way, then perhaps plain git would suffice. |
thank you @izuzak for posting this guide, I just start implementing it on my blog |
@MarkLodato Yep, it is a bit of a pain; might even be the reason why I don't blog as much as before 😄. Unfortunately, I don't have such a script, but I'd totally accept a pull request if you (or someone else) build it. I could put something together over the weekend if you don't want to bother with it, though. |
Thanks @chrishough 💖. Let me know how it works out for you. |
If you are using octopress for your blog... 1: Create a custom.css and add @izuzak styles to the file. 2: Modify source/_includes/head.html as follows to include the custom stylesheet:
3: Because we need jQuery, Modify source/_includes/custom/head.html as follows:
4: Because the latest stable of octopress uses ender, Modify source/_layouts/post.html as follows. Make sure to update it to your correct github account and path:
|
or you can take a look at hit9.org/petal :) |
@hit9 on the current version of octopress that will fail. please see my |
@chrishough Can you make this into an octopress plugin? |
@MarkLodato yes, I do plan on setting that up this weekend. Stay tuned |
after further review, I may need a bit of help with the plug in @MarkLodato, are you game? |
I hit a problem with the scripts imported from ajax.googleapis.com and datejs.googlecode.com; because http is used to load these scripts Firefox will not use them on an https page. Both are served over https too, and those work fine. Posting this to help other folks debug this issue. |
I have some news that folks might like: I created a small repository called ghpages-ghcomments that adds GitHub comments to pure gh-pages sites, no Jekyll plug-ins required. Here is an example post with comments. Features:
|
Update:@Pyrolistical and @MarkLodato: readers can now leave comments on the page. Here's a demo: http://downtothewire.io/gpgc-test/2013/12/31/whats-jekyll/ |
This is really great way to hack the comment! I've already try it on my site, besides a custom google search for your blog maybe better for people to find things interested. |
I just wanted to say, thank you so much for the brilliant idea! |
|
Is there any way to add nofollow attribute in comments? |
yey |
Awesome idea, implementing it on my blog. Thanks for the idea 👍 |
Very nice 👍 |
good :). Will you share your thoughts about having the blog itself to the original issue? |
Very cool. I'm new to GitHub and was poking around on my repository and wondered "I wonder if this issues thingy could be used for comments?" A quick Google search brought me to your post on just that topic. Great work. Seeing...
I'm assuming that's a by hand thing. I think someone needs to find a way to automate that. And even better... only creating the issue IF someone makes a comment. Cheers! |
ghpages-ghcomments is the automation you are seeking ;-)
It sounds like you are worried about having lots of repo issues opened that don't have any reader comments. Or, do you mean something else when you say "only creating the issue IF someone makes a comment" would be better? |
@wireddown What I mean by "automation" is that you don't have to "prepare" for comment by doing anything & no issues entities would be created unless somebody made a comment. So if you made 20 posts, and got 3 comments all on different posts, only 3 issues items would be created. And.. they would only be created "on the fly" as the comments were added. Cheers! |
Thanks for your sharing. Most articles I found with google tell me to use a third-party comment system which I would not like to follow. Yours is very brilliant. It is something like realizing a comment function on my own site. |
hello. |
This is because |
Thanks for catching that, @selivan and @NickCraver! 🙇 ⚡ I've updated the script link for that library so things should be back to normal. 🤞 |
great post 👍 I'm working on something similar at https://utteranc.es 🔮 |
Good job |
1 similar comment
Good job |
thanks. |
Awesome. |
This ist perfect... much thanks! With that comment system gets my blog more nerd style. Just add a archor to the comment link -> #new_comment_field www.github.com/izuzak/izuzak.github.com/issues/12/#new_comment_field 😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁 |
Thanks for your brilliant idea. During building my own Github-comments for my blog, I make my comment CSS style same with Github Issue style. |
This is cool. Thanks for sharing. Exactly what I was looking for. Haven't read all the comments here (looks like it works so well you got a lot) but why not create a form on your page to capture comment input and then using github api to push that comment to the associated issue on github? |
Take a look at https://github.com/wireddown/ghpages-ghcomments 😊 |
This is the test. |
Still useful after 10 years! |
This issue is reserved for comments on the blog post GitHub hosted comments for GitHub hosted blogs. Leave a comment below and it will show up on the blog post's Web page. Thanks!
The text was updated successfully, but these errors were encountered: