- Astro 54%
- CSS 35.9%
- JavaScript 10.1%
De README zei dat een push vanzelf live komt; dat klopt niet, het image wordt vanzelf gebouwd maar live zetten is een stap bij BB Open. Nu staat er dat de klant dat met BB Open afspreekt. Nieuw: statisch betekent niet zonder JavaScript (eigen bestanden, eigen domein, zoals de CSP eist), een ander framework mag als het met npm naar dist/ bouwt zonder inline scripts, en een koppeling met de Odoo-API die een sleutel vraagt zetten we samen op, omdat een statische site geen sleutel geheim kan houden. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| public | ||
| src | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .mcp.json | ||
| .nvmrc | ||
| astro.config.mjs | ||
| CLAUDE.md | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Astro starter
Starting point for a website hosted by BB Open, built with Astro. Copy this repository into the repository where your site will live: the one BB Open provides for you, or your own GitLab, GitHub or Forgejo. BB Open fetches it from there, builds it and publishes it on your domain.
Taking it over
git clone https://git.edano.eu/bb-open/astro-starter.git my-website
cd my-website
rm -rf .git && git init -b main
git add -A && git commit -m "Website starting point"
git remote add origin <the URL of your own repository>
git push -u origin main
Then adjust: the name in src/layouts/Base.astro (SITE_NAME), the domain in
astro.config.mjs (site), and the texts in src/pages/.
Working locally
nvm use # Node 22, see .nvmrc
npm install
npm run dev # http://localhost:4321
Before you push:
npm run check # type errors
npm run build # builds to dist/, the way BB Open does
On GitLab, the pipeline (.gitlab-ci.yml) runs the same steps on every push.
If it is red, the site will not build at BB Open either, and the previous
version stays live. Elsewhere, run the two commands above yourself.
From push to live
Push to the live branch (main). BB Open picks up the change within about
fifteen minutes and builds a new version of the site. Agree with BB Open how
that version goes live; ask if you are not sure what applies to your site.
What you can build
Static does not mean without JavaScript. Interactive components, sending a form without reloading the page, islands with React, Vue or Svelte through the Astro integrations: it all works. Two conditions, both from the Content-Security-Policy:
- Scripts live in their own files, which Astro does by default. No inline
<script>. - Requests from the browser go to your own domain. A
fetchto another domain is blocked unless BB Open has allowed that domain.
Another framework is fine too. Astro is a suggestion, not a requirement. Any framework works as long as:
- it uses npm, with
package-lock.jsonin the repository; npm run buildproduces a static site indist/, withdist/index.html;- it builds on Node 22 and needs no server at runtime;
- it does not inject inline scripts or styles. Several frameworks do that by default (Next.js, for example); the page then breaks under the CSP.
If you switch, keep CLAUDE.md and this README in line with what you use.
Connecting to Odoo
Your site can do more with your Odoo than the contact form. Other Odoo forms, such as job applications or a newsletter sign-up, work the same way: through BB Open's web server, on your own domain, without a key. Ask us to switch on the ones you need.
For anything that needs the Odoo API, such as showing products, events or vacancies, or creating records, keep in mind that a static site cannot keep a key secret: everything that reaches the browser is visible to every visitor. So we set up such a connection together, for example as a route on BB Open's web server that talks to Odoo on your behalf, or as data fetched when the site is built. Tell us what you want to connect; we are happy to help.
The rules
These are the agreements that make the site build and run safely at BB Open.
- It stays a static site. No server adapter (
@astrojs/nodeand the like) and nooutput: 'server': BB Open runs only a web server, no Node. - npm, with a
package-lock.jsonin the repository. Commit the lockfile; the build usesnpm ci. - No secrets in the repository or in the build. No API keys, no committed
.env. - No inline style or script. The web server sends a strict
Content-Security-Policy.
astro.config.mjsis already set up for that; leave those two settings in place, and do not usestyle="..."attributes or<script is:inline>. - Report external sources first. Fonts, analytics, video embeds or maps
from another domain are blocked by default. Tell BB Open which domains you
need and they will be allowed. Self-hosting (a font in
public/fonts/) always works and is faster.
The contact form
src/pages/contact.astro posts to /formulier/lead. BB Open's web server
forwards that to Odoo, where the submission becomes a lead in CRM. There is
no API key in the site.
- The field names (
contact_name,email_from,phone,partner_name,name,description) are Odoo's. Do not rename them. If you want extra fields, check with BB Open: they have to be allowed in Odoo. - The hidden field
website_urlis a spam trap. Leave it in. - The path
/formulier/leadis agreed with the web server; keep it. - Locally (
npm run dev) submitting does not work: the path only exists on the live server. You can test the layout and the validation locally. - BB Open switches on the forwarding once the Website and CRM apps are active in Odoo. Until then, submitting gives an error.
Working with Claude
This repository is set up for Claude Code:
-
CLAUDE.mdcontains the rules above, so Claude follows them without you having to repeat them every time. -
.mcp.jsonconnects the official Astro Docs MCP server (https://mcp.docs.astro.build/mcp), so Claude consults the current Astro documentation instead of guessing. Claude Code asks on first start whether you want to allow this server. You can also add it by hand:claude mcp add --transport http astro-docs https://mcp.docs.astro.build/mcp
Structure
src/pages/ one file per page; the file name is the URL
src/layouts/ the shared layout (header, menu, footer)
src/styles/ the stylesheet
public/ files copied as-is (images, robots.txt)
Questions: support@bb-open.com