Skip to content

Commit

Permalink
Bring back the form honeypot
Browse files Browse the repository at this point in the history
  • Loading branch information
jerivas committed Jun 30, 2023
1 parent 40c4916 commit 82a47bd
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"name": "Oddleventy",
"image": "node:16",
"containerEnv": {
"SHELL": "/bin/bash"
},
"forwardPorts": [8080],

"customizations": {
"vscode": {
"extensions": [
"csstools.postcss",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"formulahendry.auto-rename-tag",
"naumovs.color-highlight",
"stkb.rewrap",
"stylelint.vscode-stylelint",
"syler.sass-indented",
"tyriar.sort-lines",
"xabikos.javascriptsnippets"
],
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
},
"terminal.integrated.defaultProfile.linux": "bash",
"editor.bracketPairColorization.enabled": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"eslint.validate": ["javascript", "typescript"],
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"javascript.suggestionActions.enabled": false,
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
},
"typescript.preferences.quoteStyle": "single",
"typescript.tsdk": "node_modules/typescript/lib",
"[javascript]": {
"editor.rulers": [80]
},
"[markdown]": {
"editor.rulers": [80]
},
"[typescript]": {
"editor.rulers": [80]
},
"[html]": {
"editor.formatOnSave": false
},
"[scss]": {
"editor.rulers": [80],
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": true
}
},
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
".coverage": true,
"coverage": true,
"htmlcov": true,
".tags": true,
".cache": true,
"collected-assets": true,
"staticfiles": true,
"**/*.egg-info": true
},
"search.exclude": {
"**/node_modules": true,
"**/*.css.map": true,
"**/*.js.map": true,
"yarn.lock": true,
"yarn-debug.log": true,
"yarn-error.log": true,
"static/built": true,
"static/docs": true,
".yarn": true
}
}
}
}
}
6 changes: 6 additions & 0 deletions content/_includes/contact.macros.njk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ params:
data-form="{{ name or 'contact' }}"
method="POST"
action="{{ next }}"
netlify-honeypot="subject"
data-netlify="true"
{{ utility.show_attrs(attrs) }}>
<div data-fieldgroup="contact-info">
Expand All @@ -61,6 +62,11 @@ params:
required=true
) }}

<label data-honey aria-hidden="true">
<span>Don't fill out this field:</span>
<input name="subject" tabindex="-1" />
</label>

<div class="form-actions">
<button
data-btn="submit"
Expand Down
8 changes: 8 additions & 0 deletions src/scss/forms/_fields.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,11 @@
.form-actions {
margin-top: var(--newline);
}

// Honey
// -----
/// Apply to honey-pot SPAM-protection fields…
/// @group forms
[data-honey] {
@include config.is-hidden;
}

0 comments on commit 82a47bd

Please sign in to comment.