Skip to main content
HydroGo
Content typesTooling and schema

Tooling and schema

The hydro content-type commands, JSON Schema for editor completion, and the stock types that ship with HydroGo.

Create and validate

BASH
hydro content-type new recipes          # writes content-types/recipes.yaml
hydro content-type validate             # loads every file and reports errors
hydro content-type new events --dir my-types
hydro content-type validate --dir my-types
CommandWhat it does
hydro content-type new ID [--dir content-types]Writes a skeleton file for the new type. ID follows the id pattern.
hydro content-type validate [--dir content-types]Loads every *.yaml file in the directory and reports the first problem per file: unknown keys, bad kinds, missing relation targets, invalid ids.
Run hydro content-type validate in CI so a broken YAML never reaches a server.

Editor completion with JSON Schema

A machine-readable schema for content type files is in the repository at docs/schemas/content-type.schema.json. Add this line as the first line of a YAML file and editors with the YAML language server (VS Code YAML extension, for instance) give completion, hover docs and inline validation:

YAML
# yaml-language-server: $schema=https://raw.githubusercontent.com/hydrohq/hydrogo/main/docs/schemas/content-type.schema.json

Offline, point at a local copy instead: # yaml-language-server: $schema=../schemas/content-type.schema.json.

Stock content types

hydro new --preset ... copies stock types into your project. They are examples; edit or delete freely.

TypePurpose
site_settingsBrand name, tagline and footer texts (a single record).
site_navigationHeader and footer menu links.
faqQuestions and answers with category.
teamPeople with localized role and bio.
testimonialsCustomer quotes.
commentsReader comments that wait for moderation (draft to published).
galleriesPhoto galleries.
homepage_sections, masthead, columnists, official_announcements, ads, polls, videosBuilding blocks of the news portal preset.
Some news-portal stock types ship with Turkish labels because they were made for a Turkish news site. Edit the label and description values to your language.

Admin API for content types

The admin lists and manages content types at /api/v1/admin/content-types, and records at /api/v1/admin/content/{type}. All of them need an authenticated credential; see Admin API.