turnstile-spin
Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.
Install
npx skills add https://github.com/cloudflare/skills --skill turnstile-spinHugo
For Hugo static sites. The widget renders on any page that includes the partial; siteverify happens at whatever backend handles your form submissions (a Cloudflare Pages Function, a Worker, an external API, or a form host with a server-side hook).
Add the params to your site config:
Reference the partial from any layout or content file:
Backend (where siteverify lives)
Hugo doesn't host server-side code, so the form endpoint must live elsewhere. Two common setups:
Cloudflare Pages Function (functions/api/subscribe.js):
subscribe is the stable action for this surface. Preserve an existing custom migration action and compare the returned action to the same value. Siteverify is mandatory for every widget mode, including pre-clearance. Set TURNSTILE_HOSTNAMES to the deployment-specific frontend hostnames; a production value must not include localhost or 127.0.0.1.
After the user approves a canonical absolute WRANGLER_BIN outside the project, set the secret with (set +x; printf '%s' "$WIDGET_SECRET" | "$WRANGLER_BIN" pages secret put TURNSTILE_SECRET) (or use the dashboard's Pages → your project → Settings → Environment variables → Add secret).
External backend: any Node/Ruby/Python/Go handler can do the same call. See the vanilla-html reference for non-Cloudflare-specific snippets.
Variant: shortcode for content files
If you want to drop the widget into Markdown content (not just layouts), create a shortcode:
Use in content: