Setup is straightforward – these commits show just how easy it is:
These instructions use Heroku, but you can use a different provider (like Azure) or you can use your own server (see Custom GitHub Application for more details).
git clone https://github.com/prose/gatekeeper.git
cd gatekeeper
heroku login
APP_NAME
heroku apps:create APP_NAME
XXXX
and YYYY
GitHub application credentials:
heroku config:set OAUTH_CLIENT_ID=XXXX
heroku config:set OAUTH_CLIENT_SECRET=YYYY
git push heroku master
curl https://APP_NAME.herokuapp.com/authenticate/1234
{ "error": "bad_code" }
_data/gpgc.yml
- your GitHub username for
repo_owner
- your Jekyll repo for
repo_name
- your GitHub application Client ID for
client_id
- your Heroku (or other) application URL for
code_authenticator
- the full URL to gpgc_redirect.html for
callback_url
repo_owner: __YOUR_GITHUB_USERNAME__ repo_name: __YOUR_GITHUB_REPOSITORY__ use_show_action: false label_name: Blog post comments label_color: 666666 github_application: client_id: __YOUR_GITHUB_APP_CLIENT_ID__ code_authenticator: https://__YOUR_HEROKU_APP__.herokuapp.com/authenticate/ callback_url: http://__URL_OF_GPGC_REDIRECT_PAGE__ enable_diagnostics: false
If your site is hosted in a private repository, see you can still use ghpages-ghcomments as long as you use a public repository to store the comments. See this post for details.
##
_includes/head.html
Add a link to the
gpgc_styles.css
to the <head> element:<link rel="stylesheet" href="{{ site.baseurl }}/public/css/gpgc_styles.css">
##
_layouts/post.html
Add an include tag at the bottom (or wherever you want comments to appear):
{% include gpgc_comments.html post_title=page.title %}
_tools/gpgcCreateCommentIssue.sh
to your system $PATH.$ mv _tools/gpgcCreateCommentIssue.sh /usr/local/bin
$ sudo chmod +x /usr/local/bin/gpgcCreateCommentIssue.sh
$ if test -x "`which gpgcCreateCommentIssue.sh`"; then echo ok; fi
ok
$ gpgcCreateCommentIssue.sh install <personal_access_token>
Where <personal_access_token> is your GitHub personal API access token. Your token must have the public_repo
scope so that the hooks can create labels and issues in your repository.
git add _includes/head.html
git add _layouts/post.html
git add _data/gpgc.yml
git add _includes/gpgc_comments.html
git add public/css/gpgc_styles.css
git add public/html/gpgc_redirect.html
git add public/js/gpgc_core.js
git commit -m "Add ghpages-ghcomments"
git push
$ gpgcCreateCommentIssue.sh bootstrap
$ gpgcCreateCommentIssue.sh push <personal_access_token>