Source for www.solidjs.com, the marketing site for Solid 2.0: the home page, blog, team, media kit and resources. Docs live at docs.solidjs.com and the tutorial at tutorial.solidjs.com; this repo does not host either.
- Fast and static. Every page is prerendered at build time and served from Cloudflare's edge. No server work for first paint.
- Built with Solid 2.0. The site is its own showcase, including live, runnable REPL examples on the home page.
- Accessible and themeable. Kobalte primitives, light and dark themes, and one token file for all brand colours.
- Open to contributions. Fix a typo, add a blog post or add yourself to the team page. See Where things live.
- Solid 2.0 (
solid-js,@solidjs/web) with@solidjs/router2.0 and@solidjs/meta - SolidBase 3 with a custom theme in
src/theme(Layout.tsxwraps every route) - Kobalte (
@kobalte/core2.0 alpha) for interactive primitives: navigation menu, drawer, tabs, toggle group, accordion, tooltip, dialog, image - Plain CSS Modules and CSS custom properties. No Tailwind.
- Geist and Geist Mono (
@fontsource-variable/geist,@fontsource-variable/geist-mono) as the brand fonts - Cloudflare static assets, deployed with Wrangler
Requires Node 22.18 or newer (the build scripts run .ts files directly; see .nvmrc) and pnpm.
pnpm install
pnpm dev| Command | What it does |
|---|---|
pnpm dev |
Vite dev server |
pnpm build |
Prerenders every page to dist/client. prebuild generates public/rss.xml from src/blog/posts.ts; postbuild adds the hand-written .tsx pages to the generated sitemap.xml |
pnpm preview |
Serve the production build locally |
pnpm type:check |
tsc --noEmit for the site and the worker |
pnpm deploy |
Build, then wrangler deploy to production |
pnpm deploy:preview |
Build, then wrangler versions upload (preview version, not promoted) |
The site is fully static: no server code and no data fetching required for first paint. Live numbers (such as GitHub stars) must have a baked-in fallback.
src/routes: file routes.index.tsxis/,about.tsx,team.tsx,media.tsx, and.md/.mdxfiles are routes with YAML frontmatter (title and description).[...404].tsxis the not-found page.src/routes/blog/*.mdx: blog articles. Listing metadata (title, date, tags, image,draft) is insrc/blog/posts.ts.src/team/people.ts: maintainers shown on/team.src/components: shared UI, built on Kobalte where a Kobalte component exists.src/site.ts: site-wide constants, navigation, footer columns, social links and URLs. Unknown values are markedTODO(content)and must be filled in before launch; do not invent numbers or dates.public: static files, includingimg/(logos, bios, blog images),_headersand_redirects(Cloudflare).robots.txtandsitemap.xmlare generated at build time.
Set draft: true on a post in src/blog/posts.ts. Drafts are left out of listings, RSS and the sitemap, and are rendered noindex. Remove the flag (and set the real date) to publish.
The "What's new in Solid 2.0" tabs embed solid-repl with runnable examples (src/components/repl/examples.ts; each is a full app whose entry file is main.tsx). Nothing loads until the section is near the viewport: the prerendered HTML shows the static code, then the compiler, editor and preview load on demand (the TypeScript worker alone is about 9 MB). Examples execute live, so keep them valid Solid 2.0 and test an edit in the browser. SolidBase's REPL Vite plugin is registered in vite.config.ts.
The REPL's sandboxed preview inherits the page's Content-Security-Policy and loads modules from esm.sh, a devtools bridge from cdn.jsdelivr.net and a stylesheet from ga.jspm.io. Cloudflare comma-joins headers from every matching _headers rule, so a page-specific policy cannot loosen a site-wide one. The relaxed policy is therefore set for / only, and the strict policy is listed per path in public/_headers. A new top-level route must be added to that strict list, or it ships without a CSP.
Every page has a 1200x630 social card rendered at build time with @solidjs/ogp (satori + resvg). @solidjs/ogp normally renders on demand through server functions, which need an SSR server; this site is static on Cloudflare, so scripts/generate-og.ts (the end of postbuild) calls its @solidjs/ogp/server API and writes dist/client/og/*.png. Run pnpm og to regenerate only the images after a build.
src/og/pages.tslists the cards (static pages, plus one per published blog post) and maps a route to its image.src/theme/Layout.tsxuses it to emitog:image/twitter:imagefor every route. Unlisted routes and draft posts get/og/default.png.src/og/Card.tsxis the card, written as JSX. satori supports a subset of CSS: flexbox only, inline styles only, and any element with several children needsdisplay: flex.- Colours are read from the light (
:root) block ofsrc/theme/tokens.cssand the font is Geist (@fontsource/geist), so a brand change needs no edit insrc/og. Rebuild to refresh the images. pnpm devrenders/og/*.pngon first request (theog-dev-imagesplugin invite.config.ts), and in devog:imageuses the page's own origin, so link-preview tools pointed at the dev server work. Built output is different:og:imageis an absolute URL on the canonical origin (https://www.solidjs.com), which serves the old site until this one is deployed, so a preview deploy shows a broken image unless it is built with its own origin:VITE_SITE_URL=https://<preview-host> pnpm build(also used for canonical links andog:url).@vercel/og's Node bundle expects CommonJS globals, sogenerate-og.tsprovidesrequireand__dirnamebefore loading it. If an upgrade changes that, this is the first place to look.
All colours, radii, shadows, fonts and spacing are semantic tokens in src/theme/tokens.css, defined for light and for [data-theme="dark"]. Components never hardcode colours, so the final brand palette is a one-file change there. Fonts are --font-sans and --font-mono.
Theme switching is ours, not SolidBase's: a small inline script in src/Document.tsx sets <html data-theme> before hydration from localStorage (falling back to prefers-color-scheme), and ThemeToggle changes it.
wrangler.jsonc serves dist/client as Cloudflare static assets. Log in with pnpm wrangler login, then pnpm deploy. If you build on Cloudflare's CI, set NODE_VERSION to 22.18 or newer.
The GitHub stars, npm downloads and contributor count on the home page come from /api/stats, served by the small Worker in worker/index.ts. A cron trigger (daily, 06:00 UTC, set in wrangler.jsonc) fetches the numbers from GitHub and npm and stores them in the STATS KV namespace; visitors only read KV, never GitHub or npm. Wrangler creates the namespace on the first pnpm deploy, so there is nothing to set up. Everything except /api/* is still served straight from static assets.
- If a refresh fails, the previous number stays. If nothing has been stored yet (the first request after the first deploy), the request fills it. A snapshot over 36 hours old is refreshed by the next visitor.
- Optional:
pnpm wrangler secret put GITHUB_TOKEN(a token with no scopes) raises GitHub's rate limit for the refresh. It is not needed for one request a day. - To refresh by hand, trigger the cron from the Cloudflare dashboard (Workers,
solid2-site, Settings, Triggers). Locally,pnpm wrangler dev --local --test-scheduledafterpnpm build, thencurl "localhost:8787/cdn-cgi/handler/scheduled". - In
pnpm devthere is no Worker, so the page falls back to asking GitHub and npm directly.
MIT. See the Code of Conduct.