How Covena Works
Skill level: Everyone · Time: 10 minutes
Read this page once and the rest of the docs will make sense. Covena is built from a few ideas that repeat on every page.
The Big Picture
Covena is a static site. When you run npm run build, it turns your text files into finished HTML pages in dist/. There is no database and no admin panel: your files are the website.
config.toml ──► site settings, phone and email, forms, header, quick exit, motion, SEOmenu.en.json ─► header and footer linkstheme.css ────► colors, radii, spacing, type scale, breakpointsen.json ──────► button labels, form messages, main address, tagline
ROUTE src/pages/[...lang]/index.astro │ which sections, in which order, which header and footer │ ├─ PAGE src/content/homepage/english/-index.md │ title, SEO, named blocks for this page only │ └─ each SECTION ├─ default: src/content/sections/english/hero-portrait-navy.md └─ + page block: heroPortraitNavy: { ... }
Base.astro wraps every page: head · cookie banner · header · page · footer · back-to-top button1. Routes Decide What A Page Shows
Each file in src/pages/[...lang]/ is one page (a route). It lists the sections that page shows, top to bottom, and picks the header and footer. This is Home 1, src/pages/[...lang]/index.astro, shortened:
<Base {...data} headerVariant="panel" headerOverlay={true} footerVariant="marquee"> <HeroPortraitNavy content={heroPortraitNavy} /> <FeaturesTrio content={featuresTrio} /> <AboutCollage content={aboutCollage} /> <PracticeGridNavy content={practiceGridNavy} /> ... <ContactSplitForm content={contactSplitForm} /></Base>To move a section, move its line. To remove it from this page, delete its line, or hide it from the content file with enable: false (see step 3). The [...lang] folder makes every route exist once per language: /, /fr/, and /ar/.
2. Sections Have Default Content
Each section reads its text and images from one file in src/content/sections/<language>/. The hero above reads hero-portrait-navy.md. Change that file and the section changes on every page that uses it. src/layouts/components/sections/section-ownership.md lists every section with its file and its pages.
3. Pages Can Override Any Section
To change a section on one page only, add a block with the section’s name to that page’s content file. The homepage files list their block names in a comment at the top:
heroPortraitNavy: title: "Plain legal advice for <em>you</em>"Only the fields you write change. The rest still comes from the section file.
4. How Overrides Merge
- Fields you leave out keep the default.
- Nested objects merge, so changing a button’s
labelkeeps itsurl. - Lists replace the whole default list: copy every item you want to keep.
[]clears the list. - An empty string (
"") clears a value. enable: falsehides the section on that page.- One word wrapped in
<em>in a title is set in the accent serif font.
See Sections for the details.
5. Layouts Are Separate Components
Sections are named by kind and layout: hero/HeroPortraitNavy.astro reads hero-portrait-navy.md, and hero/HeroFramedLight.astro reads hero-framed-light.md. The options.layout value in a section file is a label, and the comment next to it lists the other layouts of that kind. To use another layout on a page, import its component in the route file in place of the current one. See Section Layouts.
6. Base Wraps Every Page
src/layouts/Base.astro adds the head tags, the cookie banner, the header, the footer, the back-to-top button, and the scripts. Each route passes it a few props:
| Prop | Values | Default |
|---|---|---|
headerVariant | panel, bar, transparent | panel |
headerOverlay | true lets the header float over the first section | false |
footerVariant | marquee, columns-light, offices | marquee |
footerReveal | true slides the page up off the footer | false |
7. Firm Details Are Set Once
The main phone and email are in [settings.contactInfo] in config.toml. The main address is contactInfo.address in each src/i18n/<lang>.json, so it can be written the local way. The offices are files in src/content/offices/. The header chips, the footers, and the call links read these, so you change them in one place. See Firm Info.
8. Small Interface Text Lives In i18n Files
Button labels, form messages, the results disclaimer, the price format, and the footer sentences are in src/i18n/en.json, fr.json, and ar.json. All three files have the same keys. See Internationalization.
9. Config Is Converted Before Astro Reads It
Astro can’t read TOML directly, so npm run dev and npm run build first turn src/config/config.toml into .astro/config.generated.json. While the dev server runs, every save of config.toml does this again. Never edit the generated file.
10. Collections Hold The Repeated Content
Practice areas, industries, attorneys, results, offices, careers, and insights are collections: one Markdown file per entry, plus -index.md for the list page. weight sets the list order (lower comes first), and draft: true keeps an entry out of the production build. Practice areas, industries, results, and offices share part of their detail pages through detailDefaults in -index.md, so each entry only sets what differs. See Collections.
11. What Happens During A Build
config.tomlis converted to JSON.- Astro checks every content file against its fields (
src/content.config.tsandsrc/sections.schema.ts). A wrong value stops the build and names the file and field. - Every route is rendered once per language into
dist/. Internal links get the language prefix on French and Arabic pages. - The sitemap,
robots.txt, the RSS feeds,llms.txt,llms-full.txt, and the Markdown copies of pages are written. - If the site URL is not set, a yellow
[site]warning prints, and the sitemap is skipped.
Development vs. Production
npm run dev | npm run build | |
|---|---|---|
| What you get | A live site at localhost:4321 that updates as you save | Finished files in dist/ to upload |
| Draft pages | Shown | Left out |
| Forms with no endpoint | Demo mode, with a hint naming the setting to fill in | Demo mode, with a plain “nothing was sent” message |
| Speed | Pages build when you open them | Every page is built at once |
Find Where Any Text Comes From
If you see text on a page and don’t know where it lives, look in this order:
- The page’s own file, in a named block (
src/content/<page>/<language>/-index.md, orsrc/content/homepage/<language>/for the homepages) - The section’s default file (
src/content/sections/<language>/) - A collection entry (
src/content/practice-areas/,attorneys/,results/,offices/,careers/,blog/, …) - The interface text (
src/i18n/<lang>.json) - The menus (
src/config/menu.<lang>.json) - Site settings (
src/config/config.toml)