diff options
author | Bern <18447002+BernCarney@users.noreply.github.com> | 2017-12-10 03:09:00 +0300 |
---|---|---|
committer | Patrick Collins <thepatrickcollins@gmail.com> | 2017-12-10 03:09:00 +0300 |
commit | b5cc3f607c9deb2e489e759699e426f7cfbbbf8a (patch) | |
tree | 4e1bd110735ca00b80419db0d7534646de21dc52 | |
parent | f8b8f61c0e0285d6050a656d736756f316caea1e (diff) |
staticman updates (#93)
config and staticman.html updates to make comments work out of the box more easily. May want to add conditional for reCAPTCHA in the future incase they don't use it
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | layouts/post/staticman.html | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index c62d768..387b438 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -56,6 +56,10 @@ pluralizeListTitles = false repo = "" branch = "" + [params.staticman.recaptcha] + sitekey = "SITE_KEY" + secret = "ENCRYPTED_SECRET" + # These are optional params related to the sidebar. They are recommended, but not # required for proper functionality. HTML is supported within the params. [params.intro] diff --git a/layouts/post/staticman.html b/layouts/post/staticman.html index df759b4..eab0e93 100644 --- a/layouts/post/staticman.html +++ b/layouts/post/staticman.html @@ -1,16 +1,16 @@ <h2>Say something</h2> {{ with .Site.Params.staticman }} - <form class="post-new-comment" method="POST" action="https://dev.staticman.net/v2/entry/{{ .username }}/{{ .repo }}/{{ .branch }}/comments"> + <form class="post-new-comment" method="POST" action="https://api.staticman.net/v2/entry/{{ .username }}/{{ .repo }}/{{ .branch }}/comments"> {{ end }} - <input type="hidden" name="options[redirect]" value="{{ .RelPermalink }}"> + <input type="hidden" name="options[redirect]" value="{{ .Site.BaseURL }}{{ .RelPermalink }}"> <input type="hidden" name="options[entryId]" value="{{ .UniqueID }}"> <input required name="fields[name]" type="text" placeholder="Your name (Required)"> <input name="fields[website]" type="text" placeholder="Your website"> <input required name="fields[email]" type="email" placeholder="Your email address (Required for Gravatar)"> <textarea required name="fields[body]" placeholder='Your message. Feel free to use Markdown (Google "Markdown Cheat Sheet").' rows="10"></textarea> - <input type="hidden" name="options[reCaptcha][siteKey]" value="6LeoGzAUAAAAAEQyc2O1okFJPFsYFgryXvpLkFJ1"> - <input type="hidden" name="options[reCaptcha][secret]" value="A2bqZay+pf0qOpY/GARlzqV7Bq9U4JzQhipNYlh44Zd7+aGYFc+5hArV5zVXl1tVHtPPL/o1BCDhy6EKiBP8eupxN4o1ISpbk5bpREJTPVgA+zSDiPmfJ4U6JNjmp752gjLcv4JOvJYzNeRnu23ZjjbT497f5EIdWRGBJGa/OHA="> - <div class="g-recaptcha" data-sitekey="6LeoGzAUAAAAAEQyc2O1okFJPFsYFgryXvpLkFJ1"></div> + <input type="hidden" name="options[reCaptcha][siteKey]" value="{{ .Site.Params.staticman.recaptcha.sitekey }}"> + <input type="hidden" name="options[reCaptcha][secret]" value="{{ .Site.Params.staticman.recaptcha.secret }}"> + <div class="g-recaptcha" data-sitekey="{{ .Site.Params.staticman.recaptcha.sitekey }}"></div> <input type="submit" value="Submit"> </form> <script src='https://www.google.com/recaptcha/api.js'></script> |