Skip to content

cobalthq/cobalt-api-docs

Repository files navigation

Cobalt API Docs

Netlify Status

These docs explain Cobalt API with walkthroughs and examples of endpoints, fields, and query parameters. You can easily add or edit pages using Markdown from the versions/ directory. All pages utilize a weight property to indicate where they're nested in navigation.

Cobalt API docs have been created with hugo and docuapi.

Requirements

  • Install hugo:

    brew install hugo
  • Or update if you already have it installed:

    brew update && brew upgrade hugo
  • Install markdownlint-cli to check markdown files against some common rules:

    brew install markdownlint-cli

Local Development

  • Build site and run server:

    # V1
    hugo server --config=versions/v1/config.yaml -D
    
    # V2
    hugo server --config=versions/v2/config.yaml -D
  • Check markdown files with markdownlint-cli:

    markdownlint -c .markdownlint.yaml versions

Dependencies

Dependencies in the repository are managed with Go Modules.

  • To update docuapi theme, run:

    go get github.com/bep/docuapi/v2
  • To update go, edit the go.mod file:

    go 1.19
  • To update hugo on Netlify, edit the netlify.toml file:

    HUGO_VERSION = "0.102.3"

Hosting

The site uses Netlify's CD pipeline and is hosted at cobalt-public-api.netlify.app.

Deployment

All commits to main, if the build is successful, will be automatically deployed to the production site (usually in < 1 minute).

Deploy previews

Any pull request against the main branch will listen for new commits and is set to auto-build, available for preview before merging (Click Details in the PR Check).

Troubleshooting

If you get found no layout file for "HTML" for kind "page" warning when you start the server, you can clean up asset caches by running hugo mod clean.

English Grammar Linter (Vale)

For more information, see GrammarLinter.md