Skip to content
AstroCraft Docs
On this theme

FAQ

/faq/ draws twenty-six questions in five groups from src/config/faqData.json.ts. It is the smallest content system in the theme and the clearest illustration of one rule: markup and schema must agree.

The five groups

Group Questions
Booking, changing, cancelling 6
What it costs, and who pays 5
On the day 5
Your notes and results 5
When it will not wait 5

Each item is a { title, body } pair. A closing note{ title, body, action } — sits below the groups for the thing an FAQ cannot answer.

The groups are written from a patient’s timeline rather than from the practice’s org chart: before the appointment, paying for it, the day itself, afterwards, and the emergency case. “When it will not wait” is last on purpose and points at urgent care rather than at a booking form.

The page this schema builder was written for

getFaqSchema in src/js/schema.ts emits FAQPage, and it ships under a rule worth restating: a FAQPage node is only emitted where the page visibly draws the questions and their answers.

That is not a stylistic preference. Search engines treat FAQPage markup describing content a visitor cannot see as a structured-data violation, and it is one of the easier ways to earn a manual action. Because the questions here are rendered in an accordion whose answers are in the DOM, the schema describes what is genuinely on the page.

getFaqSchema returns undefined for an empty list, which is what lets a caller pass a possibly-empty array without guarding — /services/<slug>/ does exactly that, since not every specialty detail carries an FAQ block.

Three routes emit FAQPage: /faq/, /book/, and any specialty detail whose detail.faq has items.

The breadcrumb is rendered once and described once

Every page with a trail follows the same pattern, and the FAQ page is the plainest example:

const trail = getTrailSchema(hero.trail, Astro.url.pathname, Astro.site);

getTrailSchema adapts the project’s own TrailItem array — the same array <PageHero> renders as visible breadcrumbs — into a BreadcrumbList. One trail, drawn twice: once as markup, once as schema. A second hand-written list would be a second place for it to drift from what the page actually shows.

Adding a question

Add a { title, body } pair to the appropriate group in faqData.json.ts. The accordion, the schema and the count all follow.

Where a question belongs is decided by the patient’s timeline, not by the department that owns the answer. A billing question asked on the day of an appointment belongs in “On the day” if that is when it is asked.

If a group grows past six or seven, the honest fix is usually a sixth group rather than a longer accordion — the groups exist so a reader can skip four fifths of the page.

Questions that live elsewhere

Specialty detail pages carry their own FAQ block in src/config/services/<slug>.ts, and /book/ carries one in bookData.json.ts. Those are questions specific to a context, and they belong beside that context rather than in the site-wide list.

The line to draw: if the answer depends on which specialty or which step the reader is in, it belongs to that page. If it is true of the practice, it belongs here.

NEXT STEPRouting