Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frontmatter validations #149

Merged
merged 14 commits into from
Nov 19, 2024
Merged

Add frontmatter validations #149

merged 14 commits into from
Nov 19, 2024

Conversation

fabianrbz
Copy link
Collaborator

@fabianrbz fabianrbz commented Nov 7, 2024

Schemas for each content_type are defined in app/_data/schemas/frontmatter/.
These are basic validations, the idea is to add more as we write docs or find new validations.

A tool that validates the frontmatter (except for plugin pages and autogenerated content for now) lives in tools/frontmatter-validator and a GH action runs it as a check.

Considerations:

  • title and content_type are required for all pages
  • description isn't required for how-tos for now, they have a tldr
  • reference pages require products or tools
  • how_tos require tldr, works_on if products == gateway

Note:

  • It outputs some warnings, I think the problem is that ajv - which is the tool that we use to load the json-schemas and validate the date - runs in strict mode and has some weird rules defined.
  • There are currently 46 errors. All of them are because those pages don't have a description, I need help fixing those.

How to run it

  1. cd tools/frontmatter-validator
  2. npm ci
  3. node index.js

@fabianrbz fabianrbz requested a review from a team as a code owner November 7, 2024 16:08
Copy link

netlify bot commented Nov 7, 2024

Deploy Preview for kongdeveloper ready!

Name Link
🔨 Latest commit f90bd9e
🔍 Latest deploy log https://app.netlify.com/sites/kongdeveloper/deploys/673ca56c56bf6f0008e2b1dc
😎 Deploy Preview https://deploy-preview-149--kongdeveloper.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@fabianrbz fabianrbz force-pushed the add-docs-schema-and-validations branch from ccd11c7 to f90bd9e Compare November 19, 2024 14:49
@fabianrbz fabianrbz merged commit d37e86c into main Nov 19, 2024
6 checks passed
@fabianrbz fabianrbz deleted the add-docs-schema-and-validations branch November 19, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants