Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Public documentation for [Distribute Aid](https://distributeaid.org), built with

- [Astro](https://astro.build/) - Web framework
- [Starlight](https://starlight.astro.build/) - Documentation theme for Astro
- [starlight-openapi](https://github.com/HiDeoo/starlight-openapi) - API reference docs from OpenAPI specs
- [Yarn](https://yarnpkg.com/) - Package manager

## Setup
Expand All @@ -14,7 +15,7 @@ Public documentation for [Distribute Aid](https://distributeaid.org), built with

You'll need the following installed on your machine:

- [Node.js](https://nodejs.org/) version >=20.0.0 <=24.11.0
- [Node.js](https://nodejs.org/) version >=22.12.0 <=24.11.0
- [Corepack](https://nodejs.org/api/corepack.html) - Ships with Node.js but needs to be enabled

### Enable Corepack
Expand Down Expand Up @@ -78,6 +79,19 @@ This project uses several tools to maintain code quality. They run automatically
- [linkinator](https://github.com/JustinBeckwith/linkinator) - Broken link checker
- [pa11y-ci](https://github.com/pa11y/pa11y-ci) - Accessibility testing (WCAG2AA via axe-core)

## API Reference

The API reference docs are auto-generated from an [OpenAPI spec](./schemas/aggregated-public-information.json) produced by the [aggregated-public-information](https://github.com/distributeaid/aggregated-public-information) Strapi backend.

To regenerate the spec after API changes:

```sh
cd path/to/aggregated-public-information
yarn strapi openapi generate --output path/to/docs/schemas/aggregated-public-information.json
```

This requires the aggregated-public-information repo to be set up locally with dependencies installed and a `.env` file configured (see that repo's README).

## Contributing

See [CONTRIBUTING.md](./src/content/docs/how-to-DA/CONTRIBUTING.md) for guidelines on how to contribute. Bug reports and feature requests are welcome as GitHub issues.
Expand Down
11 changes: 11 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
// @ts-check
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import starlightOpenAPI, { openAPISidebarGroups } from 'starlight-openapi';

// https://astro.build/config
export default defineConfig({
site: 'https://distributeaid.github.io',
integrations: [
starlight({
plugins: [
starlightOpenAPI([
{
base: 'api-reference',
label: 'API Reference',
schema: './schemas/aggregated-public-information.json',
},
]),
],
title: 'Distribute Aid Docs',
logo: {
src: './src/assets/da-logo.svg',
Expand Down Expand Up @@ -40,6 +50,7 @@ export default defineConfig({
label: 'Aggregated Public Information',
autogenerate: { directory: 'aggregated-public-information' },
},
...openAPISidebarGroups,
],
}),
],
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
"prepare": "husky"
},
"dependencies": {
"@astrojs/markdown-remark": "^7.1.1",
"@astrojs/starlight": "^0.38.4",
"astro": "^6.1.10",
"sharp": "^0.34.3"
"sharp": "^0.34.3",
"starlight-openapi": "^0.25.0"
},
"packageManager": "yarn@4.9.4",
"engines": {
Expand Down
Loading
Loading