Skip to content
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

Staticman v3 config #52

Merged
merged 2 commits into from Jul 25, 2019
Merged

Staticman v3 config #52

merged 2 commits into from Jul 25, 2019

Conversation

VincentTam
Copy link
Contributor

Resolve #46. Note that apart from this PR, you need additional steps to hook up this repo with your custom API instance in the repo settings. The actual procedures vary, depending on the Git commit SHA1 hash of your API's source code, and are not fully documented in the official site.

Modifications on theme config:

  1. endpoint: introduced in Minimal Mistakes PR 1845, it defaults to https://api.staticman.net/v2/entry/. The corresponding GitHub bot is @staticmanapp, which has recently (and silently) stopped its service.
    <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">
    • The domain name in this PR comes from Add staticman to FlutterArsenal #46 (comment).
    • Staticman v3 URL scheme comes from Staticman PR 219.
    • In the 1st commit, I carelessly omitted the trailing slash while editing online. Since it's found in the default value of endpoint in the above code block, I made the 2nd commit to fix that.
  2. branch and repository: must have to get Staticman working.
    {% when "staticman_v2" %}
    <section id="static-comments">
    {% if site.repository and site.staticman.branch %}
    <!-- Start static comments -->
    <div class="js-comments">
  3. reCAPTCHA: The displayed checkbox get the parameters from the theme config file.
    {% if site.reCaptcha.siteKey %}
    <div class="form-group">
    <div class="g-recaptcha" data-sitekey="{{ site.reCaptcha.siteKey }}"></div>
    </div>
    {% endif %}

    Therefore, reCAPTCHA parameters need to be set twice: once in Staticman config, once in theme config.
    # reCaptcha
    # Register your domain at https://www.google.com/recaptcha/ and choose reCAPTCHA V2
    reCaptcha:
    enabled: true
    siteKey: "6LdRBykTAAAAAFB46MnIu6ixuxwu9W1ihFF8G60Q"
    # Encrypt reCaptcha secret key using Staticman /encrypt endpoint
    # For more information, https://staticman.net/docs/encryption
    secret: "PznnZGu3P6eTHRPLORniSq+J61YEf+A9zmColXDM5icqF49gbunH51B8+h+i2IvewpuxtA9TFoK68TuhUp/X3YKmmqhXasegHYabY50fqF9nJh9npWNhvITdkQHeaOqnFXUIwxfiEeUt49Yoa2waRR7a5LdRAP3SVM8hz0KIBT4="

@karx karx merged commit 2edbd22 into flutterarsenal:master Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add staticman to FlutterArsenal
2 participants