The source for swift-everywhere.org — a community site about running Swift on every platform: Android, server, embedded, WebAssembly, Windows, and Linux desktop. The site also hosts a blog, an upcoming Swift events calendar, and an automated Android build-status report for the wider Swift package ecosystem.
The site is built with Astro, a static-site framework with three things worth knowing if you're new to it:
.astrofiles look like HTML with a frontmatter "code fence" (---) at the top where you can write TypeScript that runs at build time. Anything youawaitthere is resolved before the page is rendered to static HTML.- Pages under
src/pages/become URLs automatically (src/pages/blog/index.astro→/blog/). Files named[...slug].astroare dynamic routes that usegetStaticPaths()to enumerate every page they generate. - Content collections under
src/content/are markdown files typed by a Zod schema insrc/content.config.ts. Pages query them withgetCollection('blog'),getCollection('projects'), orgetCollection('events').
That's enough to follow most of this site. If you want more:
- Astro documentation — the canonical reference.
- Astro tutorial — walks you through building an Astro site from scratch.
- Content collections guide
— covers schemas, loaders, and
getCollection. - Routing guide — file-based
pages and dynamic
[...slug]routes.
You'll need Node.js (version 20 or later
recommended) and npm.
git clone https://github.com/swift-everywhere/swift-everywhere.github.io.git
cd swift-everywhere.github.io
npm install
npm run devThis starts a local development server at http://localhost:4321
with live reload — edit any file under src/ and the browser will
update automatically.
| Command | What it does |
|---|---|
npm run dev |
Start the dev server with hot reloading |
npm run build |
Produce a production build into dist/ |
npm run preview |
Serve the contents of dist/ locally to sanity-check |
npm run astro |
Run the Astro CLI directly (e.g. npm run astro check) |
Always run npm run build before opening a pull request — the GitHub
Actions deploy workflow runs the same command, and content-collection
schema mistakes (missing fields, invalid dates, bad URLs) only surface
at build time.
src/
├── components/ # reusable .astro components (Header, Footer, ProjectIcon)
├── content/
│ ├── blog/ # blog posts (markdown)
│ ├── events/ # conferences and meetups (markdown frontmatter)
│ └── projects/ # one file per Swift Everywhere workstream
├── content.config.ts # Zod schemas for the three collections
├── layouts/
│ └── BaseLayout.astro
├── pages/ # routes — file path == URL
│ ├── index.astro # landing page
│ ├── android-builds.astro # legacy Android build status report
│ ├── blog/
│ ├── events/
│ └── projects/
└── styles/global.css
public/ # static assets copied verbatim into the site root
├── favicon.svg
└── icons/projects/ # Material Symbols / Tux SVGs used by ProjectIcon
_data/ # JSON consumed by android-builds.astro (updated by CI)
Contributions are welcome via pull request. The most common changes fall into one of these categories:
- Create
src/content/blog/your-post-slug.md. - Use the existing posts as a template — required frontmatter is
title,pubDate, and an optionaltagsarray. Tag a post with a project slug (android,server,embedded,webassembly,windows,linux) to make it appear automatically on that project's landing page. - Run
npm run devand visit/blog/to preview.
Each project lives at src/content/projects/<slug>.md. Frontmatter
fields are validated by src/content.config.ts:
---
title: Swift on Foo
tagline: One-line pitch shown on cards.
tag: foo # blog posts tagged with this appear on the page
icon: foo # filename (no extension) under public/icons/projects/
tint: "#22C55E" # hex color used for the icon and page accents
order: 7
featured: true
---The body of the markdown file becomes the project's landing page
content. To add a new icon, drop an SVG (with no inline fill) into
public/icons/projects/<name>.svg so the ProjectIcon component can
tint it via CSS mask-image.
Drop a markdown file into src/content/events/:
---
title: My Swift Conference 2027
summary: A one-line description for the listing.
location: Berlin, Germany
startDate: 2027-05-12
endDate: 2027-05-14
url: https://example.com
type: conference # or "meetup"
online: false
---Past events are filtered out automatically at build time, so you don't need to clean them up after they pass.
- Fork the repository on GitHub.
- Create a branch:
git checkout -b my-change. - Make your changes and run
npm run buildlocally to confirm the site still builds. - Commit and push:
git push origin my-change. - Open a pull request against
main. CI will build the site again and report any issues. A maintainer will review and merge.
Once a PR is merged, the Build and Deploy workflow publishes the updated site to https://swift-everywhere.org automatically.