Website for Spiget, the API for Spigot resources, plugins and authors.
Built with Astro as a static site. All live data is loaded in the browser from https://api.spiget.org/v2.
npm install
npm run dev # http://localhost:4321
npm run build # static output in dist/
npm run preview # serve dist/ locally
npm run check # type check
npm run preview:worker # build and serve with Cloudflare's local runtime (http://localhost:8787)The site is hosted on Cloudflare Workers as static assets (no Worker script). Config is in wrangler.jsonc.
npx wrangler login # once
npm run deploy # astro build && wrangler deployFor Workers Builds (deploy on push), use npm run build as the build command and npx wrangler deploy as the deploy command.
| Path | What it is |
|---|---|
src/layouts/Layout.astro |
Page shell: meta tags, nav, footer, consent/ads/analytics scripts |
src/pages/ |
One file per page (/, /search/, /search/version/, /status/, /about/, /libraries/, /webhook/, /tryit/, /documentation/, 404) |
src/components/ |
Nav, footer, ad slot, search form, Try It box, remote code example |
src/scripts/ |
Browser helpers: API requests, footer alert, shared search logic |
src/styles/main.scss |
Bootstrap 5 theme (orange, Open Sans, square corners) and site styles |
public/libraries/libraries.json |
List of client libraries shown on /libraries/. Edit this file to add a library |
public/_redirects, public/_headers |
Redirects and headers, applied by Cloudflare (not served as files) |
wrangler.jsonc |
Cloudflare Workers config: serves dist/, unknown paths get 404.html, adds trailing slashes |
- Library code examples are fetched from their URLs at build time. If a URL is down, the page shows a link instead.
- Old search links like
/search/resources:worldedit/10hit the 404 page, which forwards them to/search/?q=resources:worldedit/10. This relies onnot_found_handling: "404-page"inwrangler.jsonc. - API docs on
/documentation/are rendered by Scalar from the spec in SpiGetOrg/Documentation.