Allow custom Staticman endpoints (#1845)

This commit is contained in:
Maxime Michel 2018-09-21 15:49:58 +02:00 committed by Michael Rose
parent 6d6d738e23
commit 4bd6efc323
5 changed files with 10 additions and 4 deletions

View file

@ -53,6 +53,7 @@ staticman:
type : # "date" type : # "date"
options: options:
format : # "iso8601" (default), "timestamp-seconds", "timestamp-milliseconds" format : # "iso8601" (default), "timestamp-seconds", "timestamp-milliseconds"
endpoint : # URL of your own deployment with trailing slash, will fallback to the public instance
reCaptcha: reCaptcha:
siteKey : siteKey :
secret : secret :

View file

@ -50,7 +50,7 @@
<div class="page__comments-form"> <div class="page__comments-form">
<h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4> <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}</h4>
<p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p> <p class="small">{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} <span class="required">*</span></p>
<form id="new_comment" class="page__comments-form js-form form" method="post" action="https://api.staticman.net/v2/entry/{{ site.repository }}/{{ site.staticman.branch }}/comments"> <form id="new_comment" class="page__comments-form js-form form" method="post" action="{{ site.staticman.endpoint | default: 'https://api.staticman.net/v2/entry/' }}{{ site.repository }}/{{ site.staticman.branch }}/comments">
<div class="form__spinner"> <div class="form__spinner">
<i class="fas fa-spinner fa-spin fa-3x fa-fw"></i> <i class="fas fa-spinner fa-spin fa-3x fa-fw"></i>
<span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span> <span class="sr-only">{{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}</span>

View file

@ -48,6 +48,7 @@ staticman:
type : # "date" type : # "date"
options: options:
format : # "iso8601" (default), "timestamp-seconds", "timestamp-milliseconds" format : # "iso8601" (default), "timestamp-seconds", "timestamp-milliseconds"
endpoint : # URL of your own deployment with trailing slash, will fallback to the public instance
reCaptcha: reCaptcha:
siteKey : "6LdRBykTAAAAAFB46MnIu6ixuxwu9W1ihFF8G60Q" siteKey : "6LdRBykTAAAAAFB46MnIu6ixuxwu9W1ihFF8G60Q"
secret : "PznnZGu3P6eTHRPLORniSq+J61YEf+A9zmColXDM5icqF49gbunH51B8+h+i2IvewpuxtA9TFoK68TuhUp/X3YKmmqhXasegHYabY50fqF9nJh9npWNhvITdkQHeaOqnFXUIwxfiEeUt49Yoa2waRR7a5LdRAP3SVM8hz0KIBT4=" secret : "PznnZGu3P6eTHRPLORniSq+J61YEf+A9zmColXDM5icqF49gbunH51B8+h+i2IvewpuxtA9TFoK68TuhUp/X3YKmmqhXasegHYabY50fqF9nJh9npWNhvITdkQHeaOqnFXUIwxfiEeUt49Yoa2waRR7a5LdRAP3SVM8hz0KIBT4="

View file

@ -351,6 +351,9 @@ Transform user comments into `_data` files that live inside of your GitHub repos
**Note:** Looking to migrate comments from a WordPress based site? Give [this tool](https://github.com/arthurlacoste/wordpress-comments-jekyll-staticman) a try. **Note:** Looking to migrate comments from a WordPress based site? Give [this tool](https://github.com/arthurlacoste/wordpress-comments-jekyll-staticman) a try.
{: .notice--info} {: .notice--info}
**Note:** Please note that as of September 2018, Staticman is reaching GitHub API limits due to its popularity, and it is recommended by its maintainer that users deploy their own instances for production (use `site.staticman.endpoint`).
{: .notice--warning}
##### Add Staticman as a Collaborator ##### Add Staticman as a Collaborator
1. Allow Staticman push access to your GitHub repository by clicking on **Settings**, then the **Collaborators** tab and adding `staticmanapp` as a collaborator. 1. Allow Staticman push access to your GitHub repository by clicking on **Settings**, then the **Collaborators** tab and adding `staticmanapp` as a collaborator.
@ -389,8 +392,8 @@ These settings need to be added to your `_config.yml` file as well:
repository : # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes" repository : # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes"
comments: comments:
provider : "staticman_v2" provider : "staticman_v2"
staticman: staticman:
branch : "master" branch : "master"
``` ```
**Branch setting:** This is the branch comment files will be sent to via pull requests. If you host your site on GitHub Pages it will likely be `master` unless your repo is setup as a project --- use `gh-pages` in that case. **Branch setting:** This is the branch comment files will be sent to via pull requests. If you host your site on GitHub Pages it will likely be `master` unless your repo is setup as a project --- use `gh-pages` in that case.

View file

@ -47,6 +47,7 @@ staticman:
type : "date" type : "date"
options: options:
format : "iso8601" # "iso8601" (default), "timestamp-seconds", "timestamp-milliseconds" format : "iso8601" # "iso8601" (default), "timestamp-seconds", "timestamp-milliseconds"
endpoint : # URL of your own deployment with trailing slash, will fallback to the public instance
atom_feed: atom_feed:
path : # blank (default) uses feed.xml path : # blank (default) uses feed.xml
search : true # true, false (default) search : true # true, false (default)