Summary
Content schema fields that are semantically URLs are currently typed as plain strings, so invalid URLs in frontmatter are not rejected at validation time.
Affected file:
Examples:
demoURL
repoURL
- (and any other URL-like metadata fields)
Why This Matters
Schema validation should fail early on malformed metadata, preventing broken links from entering generated pages.
Proposed Strategy
- Update URL-like fields to use Zod URL validation (e.g.,
z.string().url().optional()).
- Decide if relative URLs are allowed; if yes, add a custom validator for absolute-or-relative policy.
- Update existing content entries if validation uncovers malformed values.
Done Criteria / Validation
- Invalid URL frontmatter fails
astro check.
- Existing valid content still passes.
npm run build and npm run validate:links pass.
Summary
Content schema fields that are semantically URLs are currently typed as plain strings, so invalid URLs in frontmatter are not rejected at validation time.
Affected file:
src/content/config.tsExamples:
demoURLrepoURLWhy This Matters
Schema validation should fail early on malformed metadata, preventing broken links from entering generated pages.
Proposed Strategy
z.string().url().optional()).Done Criteria / Validation
astro check.npm run buildandnpm run validate:linkspass.