The API catalogue is built with Middleman, a static-site generator.
Pages describing the APIs are dynamically generated from the following CSV files:
data/organisation.csv
details the Organisations / Departmentsdata/catalogue.csv
details the APIs
Content for other pages is based on Markdown files located in the source
directory.
- Setup rbenv and install the Ruby version specified in
.ruby-version
- Setup Node
- Clone the git repository:
git clone git@github.com:co-cddo/api-catalogue.git
- Navigate to the project directory:
cd api-catalogue
- Install gems:
bundle install
- Install JavaScript dependencies:
npm install
- Run the test suite to verify your setup:
bundle exec rspec
If you have Docker available on your machine, and would prefer not to setup the project dependencies locally, you can run:
bin/docker_serve
By default this will build and serve the site on host port 4567. You can
navigate to http://localhost:4567
to view the site.
To preview the API catalogue locally run:
bundle exec middleman server
See the generated website on http://localhost:4567
in your browser. Any
content changes you make to the website will be updated in real time.
To shut down the Middleman instance running on your machine, use ctrl+C
.
To build the static website run:
bundle exec middleman build
If the build fails, run it again with the --verbose
flag to get detailed error
messages to help with finding the problem.
Create a pull request to make changes to the site. When the pull request is merged it'll be published automatically. See the deployment documentation for further details.
Note that there is a scorecard action. This relies on a token to access parts of the repository. The token expires periodically.
See the scorecard-action README for instructions on updated the token.