Uh oh!
There was an error while loading. Please reload this page.
feat: build the site shell and render its pages - #8
Merged
Merged
Conversation
The commit-msg hook only guards local commits; a squash merge takes its subject from the PR title, which nothing validated.
ci: lint pull request titles against the conventional preset
Types and Zod schemas are generated from the contract Folio publishes, so the shapes cannot be hand-maintained into disagreeing with it. Model types are inferred from the schemas that parse the responses, leaving one definition rather than a type and a validator that can drift apart. Reads go through the server only. The client takes its base URL and fetch, holding no reference to the environment, so it is exercised without one. Every response is parsed at the boundary, which is where a deployment that disagrees with the published contract becomes a named error instead of an undefined three components deep. Failures are reported, not decided: a category and the API's own problem details, leaving the route to choose between a 404, a retry and an error.
feat(api): add the Folio client, its models and its environment
The shell carries the navigation, locale and theme selection, and the
project index and detail views. Pages declared by the API drive the
navigation, and a splat route renders any of them from
`/v1/pages/{slug}`, with the home page served at the root.
Sections render in declaration order with a divider between each pair.
The response is validated against the published contract, and a section
type this client does not render is skipped so the rest of the page
still renders.A hero renders its headline, subheadline, calls to action and portrait. The measured dimensions drive an aspect-ratio box, so the image reserves its space before it loads. Actions render as links, routing when the API gives a path and opening a new tab when it gives a URL. The site title and tagline no longer open the home page; they carry the document title and meta description, and the hero carries the claim.
feat: build the site shell and render its pages
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The site shell, the pages rendered inside it, and the hero.
Shell. Navigation, locale and theme selection, the project index and the project detail view. Locale is resolved server-side and carried on the response, so no locale prefix appears in the path.
Pages. Pages declared by the API drive the navigation. A splat route renders any of them from
/v1/pages/{slug}; the page claiminghomeis served at the root, and its slug redirects there so one page never has two URLs. Sections render in declaration order with a divider between each pair.Hero. Headline, subheadline, calls to action and portrait. The dimensions the API measured drive an aspect-ratio box, so the image reserves its space before it loads. Actions route when the API gives a path and open a new tab when it gives a URL. The site title and tagline no longer open the home page — they carry the document title and meta description, and the hero carries the claim.
Contract handling
Every response is validated against the published contract before it reaches a component. Section types are validated leniently: a type this client does not render is skipped, so the rest of the page and the navigation around it still render. A malformed known type is a contract error rather than a silent skip. In development, a skipped section and any page slug a file route would shadow are reported to the console.
Deploys with Folio
/v1/siteno longer carries section bodies, so this requires the matching Folio release. The API goes out first.