Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ The actual pages are in [`src/pages/`](/src/pages/) and are mostly Markdown/MDX.

## Development Commands

### Node version

The repo ships an [`.nvmrc`](./.nvmrc), so with
[nvm](https://github.com/nvm-sh/nvm) installed you can pick the right version automatically:

```sh
nvm install # first time only – installs the version from .nvmrc
nvm use # switch the current shell to it
```

If `npm run build` fails with `Node.js vXX is not supported by Astro!`, you are on an
older version – run `nvm use` and try again.

### Commands

All commands are run from the root of the project:

| Command | Action |
Expand All @@ -52,6 +67,28 @@ All commands are run from the root of the project:

---

## Testing the contact form

The contact forms ([`ContactForm.astro`](/src/components/ContactForm.astro)) use hCaptcha for
spam protection, and **sending cannot be tested on a local dev server**:

- hCaptcha refuses to run on `localhost` and `127.0.0.1`.
- Its official test key renders the widget anywhere, but produces a token that only validates
against the matching test secret – which Web3Forms does not hold. Submitting then fails with
`Could not validate hCaptcha`.

So test the full send on the deployed site. Locally you can still work on everything else by
rendering the form without the captcha:

```astro
<ContactForm captcha={false} />
```

If a submission fails, the browser console carries the message Web3Forms actually returned;
the visitor only ever sees the generic localised error.

---

## Further Reading

- [Astro documentation](https://docs.astro.build)
Expand Down
Loading
Loading