Comments (5)
Hi, this is the maintainer of @staticmanlab.
You may see my Staticman + Beautiful Jekyll + Framagit demo (source) for a working example of reCAPTCHA v2 with Staticman v3 URL scheme. It's built yesterday in response to a similar issue einsteinpy/blog.einsteinpy.org#356.
from hugo-future-imperfect-slim.
After implementing #31, I've tested the reCAPTCHA integration of your theme, and reCAPTCHA isn't showing. The true cause of this error is the lack of a g-recaptcha
tag in the form
tag. You may see reCAPTCHA v2's doc for this. Here's the official example pasted here for your convenience.
<html>
<head>
<title>reCAPTCHA demo: Simple page</title>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</head>
<body>
<form action="?" method="POST">
<div class="g-recaptcha" data-sitekey="your_site_key"></div>
<br/>
<input type="submit" value="Submit">
</form>
</body>
</html>
You may compare your code
hugo-future-imperfect-slim/layouts/post/staticman.html
Lines 1 to 28 in e0eb982
with that of Beautiful Hugo.
<form class="js-form form" method="post" action="{{ .Site.Params.staticman.api }}">
<input type="hidden" name="options[slug]" value="{{ replace .RelPermalink "/" "" }}">
<input type="hidden" name="options[parent]" value="">
{{ if .Site.Params.staticman.recaptcha }}
<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 }}">
{{ end }}
<fieldset>
<div class="textfield">
<textarea name="fields[comment]" type="text" placeholder="{{ i18n "useMarkdown" }}"></textarea>
</div>
</fieldset>
<!-- skipped fieldsets -->
{{ if .Site.Params.staticman.recaptcha }}
<fieldset>
<div class="g-recaptcha" data-sitekey="{{ .Site.Params.staticman.recaptcha.sitekey }}"></div>
</fieldset>
{{ end }}
<fieldset>
<button class="button">
Submit
</button>
</fieldset>
</form>
</section>
from hugo-future-imperfect-slim.
Pleaes forget my previous comment. It seems the cause is
"The resource from “https://www.google.com/recaptcha/api.js?render=6Lcv8G8UAAAAAEqV1Y-XEPum00C_DxhD6O--qkFo” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)."
from my Firefox browser.
Updated: Oh! I thought it was reCAPTCHA v2. In fact you're using v3. Need to explore this later. So forget my previous comment.
from hugo-future-imperfect-slim.
Related issue: eduardoboucas/staticman#223
from hugo-future-imperfect-slim.
Update: Looking at Staticman's PRs, I've found an attempt to support reCAPTCHA v3 with Staticman. Unluckily, it's mixed with lots of changes and it was closed. I've made eduardoboucas/staticman#413 for that.
from hugo-future-imperfect-slim.
Related Issues (20)
- FEATURE: Full Twitter Cards markup support HOT 1
- BUG: article tags organization doesn't conform to w3c standard
- BUG: Staticman reply to functionality broken
- BUG: Use https
- BUG: Search dont work under some circumstances HOT 5
- BUG: Manage the menu HOT 6
- HELP: Setting an image in blog HOT 10
- FEATURE: user-header.js and user-footer.js HOT 2
- BUG: missing demo site's top bar translations for some languages HOT 2
- FEATURE: Tile Layout HOT 4
- QUESTION: Build fails on Netlify but works locally HOT 1
- QUESTION: Make homepage /"Home"-link to static site HOT 2
- QUESTION: Search function only works locally HOT 2
- BUG: readme.md link to live demo is broken HOT 1
- QUESTION: code fences not highlighted as expected HOT 2
- BUG: Contact Form - exampleSite emailservice & Formspree link confusion HOT 1
- QUESTION: Does webhook work with GitHub App for Staticman
- BUG: failed to render pages
- BUG: search option in top menu gives error: Error loading search results...
- NOTICE: Theme is no longer maintained. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-future-imperfect-slim.