Skip to content

Repository files navigation

Open Home Foundation website

This is the source of the Open Home Foundation website, built with Astro.

Development

Requires Node.js (see .nvmrc for the version).

npm install
npm run dev      # start a dev server at http://localhost:4321
npm run build    # build the production site into dist/
npm run preview  # serve the built site locally

Project layout

  • src/pages/ — one file per page (Astro pages, plus markdown papers)
  • src/content/blog/ — blog posts (markdown)
  • src/layouts/, src/components/ — shared templates
  • src/styles/, src/scripts/ — CSS and client-side JavaScript, bundled by Astro
  • src/data/ — YAML data (authors, documents, hardware press kits)
  • public/ — static files copied verbatim (documents, images, fonts, badges, redirects)
  • list/ — the Plausible referrer allowlist and site registry (validated on every build)

Analytics (Plausible)

This site serves the shared Plausible loader used by every Open Home Foundation site. A site enables analytics with a single tag and nothing else — no build step, no init code:

<script async src="https://www.openhomefoundation.org/plausible.js?site=example.org"></script>

The loader (generated by src/pages/plausible.js.ts) looks the ?site= value up in list/plausible-sites.json to find that site's Plausible script id, installs a referrer filter, and then loads the site's real Plausible script.

Sites that trigger their own pageviews (single-page apps, custom routing) add &manual to the tag: nothing is tracked automatically and the page calls plausible("pageview") itself. This is the current-generation replacement for Plausible's legacy script.manual.js, which predates transformRequest and therefore cannot enforce the referrer filter — with &manual the same script is loaded with automatic pageviews off, and the filter still applies to every event, since transformRequest is set once at init and runs on every request the tracker makes for the lifetime of the page. The filter replaces any referrer not on list/allowed-referrers.txt with https://unlisted.invalid/, so visitors arriving from their own Home Assistant or ESPHome instance never have their private URL recorded.

Both list files are validated by src/lib/referrers.js on every build (an invalid entry fails the build), and both are baked into /plausible.js at build time — deploying this site updates the allowlist for every embedding site, including ones without a build workflow (e.g. Squarespace, the forums). The allowlist is also published as /allowed-referrers.json.

To add a site: put a "domain": "script-id" pair in list/plausible-sites.json (the script id is the pa-… filename part from Plausible's Site Installation page), then add the tag above to the site with ?site=<domain>. Full registry documentation is in src/lib/plausible-sites.js, since JSON can't carry comments.

Deployment

This website is automatically deployed with Cloudflare pages on each commit to the main branch.

Badges

This repository also contains the badges for various projects and partners to use with permission. Below are examples of how these are to be used in a repository.

Collaborator

A collaboration with the Open Home Foundation

[![A collaboration with the Open Home Foundation](https://www.openhomefoundation.org/badges/ohf-collaboration.png)](https://www.openhomefoundation.org/)

Library

A library from the Open Home Foundation

[![A library from the Open Home Foundation](https://www.openhomefoundation.org/badges/ohf-library.png)](https://www.openhomefoundation.org/)

Open Standard

An open standard from the Open Home Foundation

[![An open standard from the Open Home Foundation](https://www.openhomefoundation.org/badges/ohf-open-standard.png)](https://www.openhomefoundation.org/)

Project

A project from the Open Home Foundation

[![A project from the Open Home Foundation](https://www.openhomefoundation.org/badges/ohf-project.png)](https://www.openhomefoundation.org/)

About

Website of the Open Home Foundation

Resources

Code of conduct

Stars

14 stars

Watchers

4 watching

Forks

Contributors

Languages