~xdavidwu/xdavidwu.link

d09d4902f5aa7b18e72e98a3a47ba47094fe580c — Maxime Michel 5 years ago 20bcef3
Allow custom Staticman endpoints (#1845)

2 files changed, 3 insertions(+), 2 deletions(-)

M _config.yml
M _includes/comments.html
M _config.yml => _config.yml +1 -0
@@ 53,6 53,7 @@ staticman:
      type               : # "date"
      options:
        format           : # "iso8601" (default), "timestamp-seconds", "timestamp-milliseconds"
  endpoint               : # URL of your own deployment with trailing slash, will fallback to the public instance
reCaptcha:
  siteKey                :
  secret                 :

M _includes/comments.html => _includes/comments.html +2 -2
@@ 50,7 50,7 @@
          <div class="page__comments-form">
            <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>
            <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">
                <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>


@@ 168,4 168,4 @@
    {% when "custom" %}
      <section id="custom-comments"></section>
  {% endcase %}
</div>
\ No newline at end of file
</div>