Skip to content

Commit

Permalink
Implement recaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
bliemli committed Dec 30, 2024
1 parent 30fbce6 commit 93b1690
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
10 changes: 5 additions & 5 deletions config/_default/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ params:
- Breitenrain
customHeadHTML: |
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" type="text/css" href="/css/hoppy.css">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" type="text/css" href="/css/hoppy.css">
markup:
goldmark:
renderer:
unsafe: true
tableOfContents:
startLevel: 1
endLevel: 2
endLevel: 4
13 changes: 7 additions & 6 deletions config/production/hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
params:
customHeadHTML: |
<script async src="https://analytics.umami.is/script.js" data-website-id="6275a9ce-bf8b-4475-81f5-3ca835d022ae" data-do-not-track="true"></script>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" type="text/css" href="/css/hoppy.css">
<script src="https://analytics.umami.is/script.js" async data-website-id="6275a9ce-bf8b-4475-81f5-3ca835d022ae" data-do-not-track="true"></script>
<script src="https://www.recaptcha.net/recaptcha/api.js" async defer></script>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" type="text/css" href="/css/hoppy.css">
2 changes: 2 additions & 0 deletions content/de/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ form:
required: true
message: Nachricht
method: post
recaptcha:
sitekey: 6Lf0xqkqAAAAAN6PqbE8azdGP8aZEXld-YuDRKBx
submit: Abschicken
---
4 changes: 3 additions & 1 deletion content/en/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Contact
type: contact

form:
action: https://forms.un-static.com/forms/edabbc7e6afca6f165ce36fc7b6fa6997859c092
action: https://forms.un-static.com/forms/3c151b12d8494b3a769eddba4369037b93a1cbea
input:
- label: Name
id: name
Expand All @@ -17,5 +17,7 @@ form:
required: true
message: Message
method: post
recaptcha:
sitekey: 6Lf0xqkqAAAAAN6PqbE8azdGP8aZEXld-YuDRKBx
submit: Send
---
5 changes: 4 additions & 1 deletion layouts/partials/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ <h1>{{ .Title | markdownify }}</h1>
{{ $formInput := .Params.form.input }}
{{ $message := .Params.form.message }}
{{ $method := .Params.form.method }}
{{ $sitekey := .Params.form.recaptcha.sitekey }}
{{ $submit := .Params.form.submit }}

<div class="contact-form">
Expand All @@ -19,11 +20,13 @@ <h1>{{ .Title | markdownify }}</h1>
<label for="message"><span data-feather='message-square'></span> {{ $message }}:</label><br />
<textarea id="message" name="message" cols="40" rows="10" required></textarea><br />

<div class="g-recaptcha" data-sitekey="{{ $sitekey }}"></div>

<button name="submit" type="submit"><span data-feather='send'></span> {{ $submit }}</button>
</form>

<div>
<p><small>(Powered by <a rel="nofollow" href="Un-static Forms">Un-static Forms</a>)</small></p>
<p><small>(Powered by <a rel="nofollow" href="https://un-static.com/">Un-static Forms</a>)</small></p>
</div>
</div>
</div>

0 comments on commit 93b1690

Please sign in to comment.