Starting a new directory
1. Duplicate it
Section titled “1. Duplicate it”The short version: Put your site online, or npm run setup.
Copy the folder without its installed and generated files, then give the copy its own history:
rsync -a --exclude node_modules --exclude .astro --exclude dist --exclude screenshots \ "path/to/directory-starter/" "path/to/my-directory/"cd path/to/my-directorygit remote remove origin # if the copy kept the starter's remote# or start a fresh history: rm -rf .git && git initnpm installnpm run build # confirms the copy works (it warns about the placeholders below)Push it to a private GitHub repository. That’s the recommended setup. The submission pipeline, the daily rebuild and the link checker all work there (Private repositories).
If you clone it from a repository instead, run git remote remove origin (or git remote set-url origin <your new repo>) straight away, so you never push to the starter.
2. Rebrand through the brand block
Section titled “2. Rebrand through the brand block”The short version: Put your site online, or npm run setup.
Everything brand-related is in src/config/site.config.json:
brand:name,look(preset: one of the six looks,sableby default; optionalcornersandspacing),layout(hero:search,splitorcompact;cards:card,rowortile),colors(optional: any colour role here overrides the look’s;npm run qa:lookchecks the looks’ contrast), optionalfontandheadingFont(a Google Font in place of the look’s own, self-hosted faces),logo(a light logo: it sits on the dark header). The owner’s look settings are laid over these.brand.pageLoaderandbrand.pageTransitions(bothtrue): a thin bar in the primary colour along the top of the window when a page takes more than 150ms to load, and a short fade with a slight rise between pages (the browser’s own view transitions, timed tobrand.motion). Browsers without view transitions (Firefox, for now) get the same fade and rise as each page loads, in CSS only, and never both. Both are off with reduced motion, andfalseturns either off.- The icon: Settings → Your site → Icon in the editor (
iconinsrc/config/settings/site.json), one square PNG or SVG, at least 512 pixels across. The build makes every size from it under/icons/and/favicon.ico(src/lib/site-icon.ts,src/pages/icons/[file].ts) and pointsbrand.faviconat them. Or, with no icon set, replace the two icon masters inpublic/images/icons/(favicon.svg, a tab-size mark, andicon-home.svg, the same mark with room around it) and runnpm run icons. Once the logo is replaced and the icon isn’t, the build,npm run doctorand the editor say so; with the masters replaced by hand, set the icon or ignore that note. The default share image (the one a link to any page without its own shows) is drawn at build time from the SEO title, the look’s colours and your name, served at/og/site.png(seo.image), so it rebrands with the rest; to use your own, put a 1200 × 630 file inpublic/images/and pointseo.imageat it ("/images/your-file.png"). baseURL: the real domain. Until then every build warns androbots.txtblocks all crawlers.seo(default title and description),footer(CTA, description, email, phone, address; bracketed placeholders like[CLIENT TO PROVIDE: phone]are hidden),headerButton,author,locale(e.g.en-CAorfr-CA).
Labels in headerButton and footer.cta may use {singular}, filled from the directory config (“Submit a {singular}”). The generated blog covers rebrand with the brand block automatically. THEME_CATALOG.md → Rebranding has the details, and the contrast scripts (hlall, texture-contrast, covercontrast) check the new colours.
3. Set up the directory: directory.config.json
Section titled “3. Set up the directory: directory.config.json”src/config/directory.config.json is validated on every run; a bad value stops the build and names the key.
The owner’s settings come first. What the content editor’s Settings pages set (the name, address, logo and colours; the item noun; the forms; the sponsorship packages; the features; submissions; the footer; the analytics service; the embed services; the menu; the newsletter) lives in src/config/settings/*.json, laid over directory.config.json, site.config.json and social.json at every build (src/lib/settings). Change those values on the Settings pages, or in the settings files: the config files keep the fallback for each, used if a settings value can’t be (the build warns, and the editor says which). npm run setup writes both. A project made before Settings existed gets its files with npm run settings:migrate. Each page shows the essentials first and the rest under Advanced (the advanced object in each file). Settings files from Release 1.0.0, without it, still work: npm run settings:migrate -- --upgrade rewrites them in today’s shape, values unchanged, and npm run setup does it before it writes a setting. In code, read the site config through src/config/site.ts and social.ts, which include the settings.
labels: the item noun (singular,plural: “listing”, “tool”, “company”), the pricing model labels, badges, and the fixed strings the filter bar, pagination and search show.listing:pageSize,defaultCountry(a two-letter country code for listings that don’t give one; empty by default, so no country is assumed),schemaType(OrganizationorSoftwareApplication),relatedCount,shareImages(a generated 1200 × 630 share image per listing,/og/listings/<slug>.png: logo, name and tagline in the brand’s colours and fonts, redrawn with the brand block; the fonts come from the files Astro’s font API already keeps for the site, so it needs no network connection; a variable font is fixed at each weight first, since satori would draw it in its default weight; if a font can’t be read it falls back to the default share image),featuredMinimum(a category, region or tag page shows its featured block only with at least this many listings).pages: region, tag and integration pages on or off, and the editorial policy, corrections policy and media kit (editorialPolicy,corrections,mediaKit);indexThreshold(below it a region, tag or integration page is noindex and out of the sitemap).integrations:chipLimit(how many integrations a listing page shows before “and N more”) andlogos(off by default; see “Integrations” below).attributes: the directory’s own facts about each listing (see “Listing attributes” below), andbadgeLimit, the most badges a card shows.filtersandsort: which filters the filter bar shows, in order (category,pricing,region,tag,integration, andattr:<id>for an attribute), and the sort options. A filter with more than 12 options gets a box to narrow them.saved: saved listings on or off (enabled). Only listing slugs are kept, in the visitor’s browser (localStorage); if the browser won’t keep them (some private windows), the buttons hide and/savedsays why. A shared list is/saved?list=a,b,c. Labels:labels.saved; page copy:pages/saved.json.share: the Share menu on the saved page and listing pages. Copy link comes first, thennetworksin the order given (email,whatsapp,x,linkedin,facebook,bluesky,reddit,telegram; default the first five), as plain share addresses: no third-party scripts, so the security policy doesn’t change.native(on) adds the phone’s own share sheet at the top where the browser has one. Labels:labels.share.recent: recently viewed listings on or off (enabled), how many it keeps (limit, 12) and where they show (show:home, once there are two;listing, as “You looked at” above Similar listings;saved, under the saved list). Like saved listings it lives in the visitor’s browser only (slugs and times), says so beside it, and has Clear history. Labels:labels.recent.outbound:refadds?ref={your domain}to the Visit website links, so listing owners see the visits in their analytics (refValueoverrides the domain). It’s left off sponsored links and addresses that already carry tracking (ref,via,utm_*, affiliate or click ids).newest: the Recently added page (/listings/new: every listing, newest first bydate_added, grouped by month;enabled,pageSize).newcan’t be a listing slug.feeds: the RSS feeds (enabled,categories: one per category,integrations: one per integration,limit: listings per feed). The new listings feed is/listings/rss.xml, a category’s/categories/<slug>/rss.xml; the blog’s,/blog/rss.xml, is always on. Feed titles arelabels.feeds.forms: the submit and contact forms’ service (Forms), andreport(for “Report an issue”: emptyprovideruses the contact form’s service, so reports arrive with no setup; give it its own form to filter them).report: “Report an issue” on every listing page on or off (enabled), and thereasonsit offers, in order (wrong-info,website,closed,spam,duplicate,other; their labels and the dialog’s copy are inpages/listing.json→report). It sends the reason, the details, an optional email and the listing’s name, slug and address. Without JavaScript the link goes to the contact page with its topic set.collections: the curated lists on or off (enabled; see “Collections” below).reports: the annual report’s pages on or off, their route, and which sections show, in order (see “The annual report” below).embeds: “Embed this list” on category and collection pages: on or off, which lists, how many listings at most, the “Powered by” line (see “Embeddable lists” below).quiz: the “Find the right {singular}” quiz: on or off, its route, how many results it shows, and its questions (see “The quiz” below).security: the site’s Content-Security-Policy, which decides where pages may load scripts, frames, fonts and connections from. The site’s own features need nothing here. Add outside services toallowby preset name ("plausible","google-analytics","mailchimp", …) or by origin. See The security policy for the presets and examples.
4. Rename routes
Section titled “4. Rename routes”Set routes in directory.config.json, e.g. "listings": "tools" and "categories": "topics", and the whole site follows: pages, links, breadcrumbs, the sitemap, JSON-LD and the search index. The menu and footer use route tokens (@listings, @categories, @integrations, @search, @submit), so menu.json needs no change. A route name is one lowercase segment and can’t clash with another route or an existing page.
If the site is already live, renaming routes changes its URLs: add redirects for the old ones (Cloudflare Pages: a public/_redirects file).
5. Replace the demo content
Section titled “5. Replace the demo content”npm run demo:clear # lists the demo listings, their logos, and the demo categories, tags, regions, integrations and attributes no listing usesnpm run demo:clear -- --yes # removes themOr hide them instead, without deleting anything: turn off Show the example listings on the editor’s Settings → Features page ("examples": false in src/config/settings/features.json; examples.show in directory.config.json is the fallback). The site then leaves out exactly what demo:clear would remove (the demo listings and their placements, the demo collections and report, and demo categories, tags, regions and integrations no other listing uses), and setting it back to true brings them back. The demo attributes stay defined, with no listing giving them a value, so their filters show no options.
Then replace:
src/content/directory/categories.json,tags.jsonandregions.jsonwith your own. Regions are whatever your directory divides its area into (states, provinces, counties, cities or neighbourhoods); rename them in the page copy (pages/region.json, the homepage’s numbers inpages/home.json, and the submit form’s label inpages/submit.json). The demo set is made up, sonpm run demo:clearremoves it once no listing uses it.src/content/directory/pages/: the directory pages’ copy, one file per page (every one is marked “Demo copy”). Coming from an older copy of the starter with a singlepages.json? The build says so:npm run pages:split -- --yesmoves each page into its own file.- The blog posts in
src/content/blog/,src/content/pages/privacy.mdxandterms.mdx, the thank-you pages,src/content/contact/index.mdx. - The professionalism pages:
src/content/pages/editorial-policy.mdx,corrections.mdxandmedia-kit.mdx. Each is demo copy that opens with a “Before you publish this page” checklist of what you must decide (itschecklistin the front matter); rewrite the page, then removedemo: true. Switch any of them off withpages.editorialPolicy,pages.correctionsorpages.mediaKit; their footer links (@editorial,@corrections,@media-kit) drop out with them. The media kit’s numbers, downloads and press mentions come frommediaKitindirectory.config.json(audienceas{ "label", "value" }withasOf;assetsas{ "label", "src", "dark" }, the brand logo by default;pressas{ "name", "title", "url", "date" }); the audience and press sections hide while they’re empty, so never fill them with estimates.
Content files and the CMS
Section titled “Content files and the CMS”The content files are written in the CMS’s own style (the content editor), so a save in the CMS changes only what you edited:
- JSON data files: two-space indents.
- Front matter: plain YAML, with lists one item a line.
- Key order: each file’s keys follow its schema.
After editing files by hand, run npm run content:format to put them back in that style (-- --check only lists the ones that differ). It never changes a value.
The files have no comments. The CMS drops YAML comments when it saves, so the guidance that used to be in them is here and in the CMS’s field hints:
- Listings:
demo: truemarks a demo listing, shown with a “Demo” chip.npm run demo:clearremoves it.review_notes, written by the submission pipeline, lists what to check before publishing. It’s never shown on the site, and the build warns while a published listing still has notes. how-we-review.mdx:- Keep the headings. Badges and trust labels link to them:
#verified,#details-checked,#website-checked,#editors-pickand#sponsored, and#attr-<id>from the attribute definitions. - Keep the attribute definitions block.
- Keep the three trust labels distinct when you rewrite them.
- Keep the headings. Badges and trust labels link to them:
media-kit.mdx: the audience numbers, downloads and press mentions come frommediaKitindirectory.config.json.- Pages with
demo: true: they open with their checklist until you turn it off.
Long-form pages (src/content/pages/*.mdx):
- Components need no import. A page uses its components (
<AttributeDefinitions />, the media kit’s<MediaKitAudience />,<MediaKitAssets />and<MediaKitPress />) without importing them: the layout passes them in, and the CMS shows each one as a block. - To add a component:
- Write the component.
- Add it to
src/lib/cms/page-components.ts, with the text props an editor may set. - Add it to
src/components/directory/page-components.ts. The build checks that the two lists match.
- No MDX comments (
{/* … */}). The CMS escapes them when it saves a page, and MDX can’t read the result, so the build stops and names the file and line.
npm run dev also routes a few pages for you alone (devOnlyPages in astro.config.mjs, files in src/dev-pages/): the component lab (/component-lab), the style guide (/style-guide), the setup checks (/_setup) and the looks side by side (/_brand). A build never contains them. The base theme’s agency pages, and the components only they used, are gone.