Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit ff52ad0
Author: Vincent Tam <[email protected]>
Date:   Sun Aug 11 10:14:52 2019 +0200

    Simplify code for calling Staticman

    In the same spirit of ac8c52a.

commit 220e0f5
Merge: 5ccfc71 7ed1b06
Author: pacollins <[email protected]>
Date:   Sun Aug 11 01:06:12 2019 -0400

    Merge branch 'Revert-staticman-recaptcha'

commit 5ccfc71
Author: pacollins <[email protected]>
Date:   Sun Aug 11 01:03:58 2019 -0400

    Revert socnet deletion

commit ac8c52a
Author: pacollins <[email protected]>
Date:   Sun Aug 11 01:01:48 2019 -0400

    Remove redundancy of recaptcha.recaptcha

commit 320c0d8
Author: pacollins <[email protected]>
Date:   Sun Aug 11 01:01:24 2019 -0400

    Remove extra article tag

commit 7ed1b06
Author: Vincent Tam <[email protected]>
Date:   Sun Aug 11 02:04:04 2019 +0200

    Fixed missing braces to load reCAPTCHA site key

    Further testing is going to be carried out to see if pacollins#45 works.

commit 8484671
Merge: 1ce3d53 f0ec5ac
Author: Patrick Collins <[email protected]>
Date:   Fri Aug 9 21:45:43 2019 -0400

    Merge branch 'master' into Revert-staticman-recaptcha

commit 1ce3d53
Author: pacollins <[email protected]>
Date:   Fri Aug 9 21:39:01 2019 -0400

    Revert to ReCAPTCHA 2 for Staticman
  • Loading branch information
VincentTam committed Aug 11, 2019
1 parent aaec96c commit 5a3e756
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ disableLanguages = [""]
branch = ""

[params.staticman.recaptcha]
recaptcha = false
# Both keys must be present to enable recaptcha
siteKey = "" # Site Key
encryptedKey = ""

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<link rel="stylesheet" href="{{ . | relURL }}">
{{ end }}
{{ end }}
{{ if .Site.Params.staticman.recaptcha.recaptcha }}<script src='https://www.google.com/recaptcha/api.js'></script>{{ end }}
{{ if and .Site.Params.staticman.recaptcha.siteKey .Site.Params.staticman.recaptcha.encryptedKey }}<script src='https://www.google.com/recaptcha/api.js'></script>{{ end }}
{{ .Scratch.Set "Permalink" .Permalink }}
{{ .Scratch.Set "Title" .Title }}
{{ .Scratch.Set "Author" .Author }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/post/comments.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<article class="post">
{{ template "_internal/disqus.html" . }}
</article>
{{ else if .Site.Params.staticman.staticman }}
{{ else if .Site.Params.staticman }}
<article class="post">
{{ .Render "staticman" }}
</article>
Expand Down
4 changes: 1 addition & 3 deletions layouts/post/content-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@
{{ .Render "stats" }}
</footer>
</article>
<article class="post">
{{ .Render "comments" }}
</article>
{{ .Render "comments" }}
{{ .Render "pagination" }}
10 changes: 6 additions & 4 deletions layouts/post/staticman.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ <h2>Say something</h2>
<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>
{{ if .Site.Params.staticman.recaptcha.recaptcha }}
<input hidden name="options[reCaptcha][siteKey]" value="{{ .Site.Params.staticman.recaptcha.sitekey }}">
<input hidden name="options[reCaptcha][secret]" value="{{ .Site.Params.staticman.recaptcha.encryptedkey }}">
<div class="g-recaptcha" data-sitekey="{{ .Site.Params.staticman.recaptcha.sitekey }}"></div>
{{ if and .Site.Params.staticman.recaptcha.siteKey .Site.Params.staticman.recaptcha.encryptedKey }}
{{ with .Site.Params.staticman.recaptcha }}
<input hidden name="options[reCaptcha][siteKey]" value="{{ .sitekey }}">
<input hidden name="options[reCaptcha][secret]" value="{{ .encryptedkey }}">
<div class="g-recaptcha" data-sitekey="{{ .sitekey }}"></div>
{{ end }}
{{ end }}
<input type="submit" value="Submit">
</form>
Expand Down
8 changes: 1 addition & 7 deletions static/css/main.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions static/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,10 @@ textarea {

/* ----------------------------------Add-Ons--------------------------------- */

/* Remove Recaptcha Badge */
/* Format reCaptcha */

div.grecaptcha-badge {
display: none !important;
.g-recaptcha {
margin: -0.25em 0 0.25em 0;
}

/* Fancybox */
Expand Down

0 comments on commit 5a3e756

Please sign in to comment.