Skip to content
mdlake

Find what to change

Go from something you see on your site to the place that changes it, including the parts that are not in your repository.

On this page

For developers. You see something on your site and want to change it, but you cannot find the file. This page takes you from what you see to the place that changes it. You do not need to know Astro to use it.

Why you cannot find the file

A generated site is small on purpose. The engine is in the kit, the package @mdlake/site-kit, which is installed in node_modules. A new site’s src/ folder holds configuration and design tokens. It has no home page, no header and no footer, so searching your repository for them finds nothing.

Nothing is missing. Everything on a page comes from one of three places:

WhereWhat it holdsHow you change it
The lakeAll the words and imagesEdit in the CMS and publish
plan.md and design.mdWhich pages exist, what they show, colours and fontsEdit the file and run a command
The kitHow things are drawn: the header, the footer, the modulesWrite your own file and register it. The kit stays as it is.

From what you see to where to change it

You want to changeIt comes fromDo this
Text on a pageA document in the lakeEdit it in the CMS and publish
The browser title or search description of a pageThe document’s title and summaryEdit them in the CMS and publish
The order of the docs sidebarFolder and document order in the lakeDrag them into place in the CMS
The logoAn asset in the lake, in slots in plan.mdChange logo, then run plan-to-config
The share imageAn asset in the lake, in slots in plan.mdChange ogImage, then run plan-to-config
The site namename in the yaml site block of plan.mdChange it, then run plan-to-config
Colours, fonts, corner radiusdesign.mdEdit it, then run regenerate
Which pages exist, the links in the headerplan.mdEdit it, then run plan-to-config
Which modules a page has, and their orderplan.mdEdit it, then run plan-to-config
The faviconpublic/favicon.svgReplace the file
An old address that should still workredirects.jsonAdd "/old/": "/new/"
The header or the footerThe kit’s layoutWrite your own layout and register it in site.config.ts
The home page, or how one kind of module looksA kit moduleWrite your own module and register it in site.config.ts
A page that fits no module, or the 404 pageA routeAdd a file to src/pages/. Your file wins over the kit’s route.

The commands are these. Run them in the site folder.

PowerShell
node "<plugin>\scripts\plan-to-config.mjs" .
node "<plugin>\scripts\apply-design.mjs" .

plan-to-config rewrites lake.config.ts and src/pages.config.ts, so do not edit those two by hand. apply-design writes the tokens into src/styles/global.css. The regenerate skill runs it for you and checks the result.

Changes in the lake reach the site with its next build. A site in live mode reads the newest content when it builds. A site in snapshot mode moves with the refresh-content skill.

Which module draws a part of a page

Open src/pages.config.ts and find the route. Its modules are listed from the top of the page to the bottom.

TypeScript
home: {
  path: '/',
  modules: [
    { module: 'hero', from: { document: 'home' } },
    { module: 'featureGrid', from: { collection: 'services' } },
    { module: 'cta', from: { document: 'contact' } },
  ],
},

Then read the kit’s file to see how that part is drawn. All paths below are in node_modules/@mdlake/site-kit/dist/.

Part of the pageName in site.config.tsKit file
Header, footer and the frame around each pagelayoutlayouts/Layout.astro
The large opening blockherocomponents/modules/Hero.astro
A grid of cardsfeatureGridcomponents/modules/FeatureGrid.astro
Numbered stepsstepscomponents/modules/Steps.astro
A quotetestimonialcomponents/modules/Testimonial.astro
Key figuresstatscomponents/modules/Stats.astro
Questions and answersfaqcomponents/modules/FAQ.astro
A call to actionctacomponents/modules/CTA.astro
A document as an articlerichTextcomponents/modules/RichText.astro
The top of a customer storycaseHeadercomponents/modules/CaseHeader.astro
The docs home and each docs pagedocsPagecomponents/modules/DocsPage.astro
A formformcomponents/modules/Form.astro
The block at the end of a detail pageendOfPagecomponents/modules/EndOfPage.astro

The header and the footer have no file of their own. They are written directly in Layout.astro.

Smaller shared parts are in components/, such as MobileNav.tsx, DocsSidebar.tsx, DocsSearch.tsx and LakeImage.astro. You replace those with parts in site.config.ts.

Warning

Read these files, but do not edit them. The next install puts them back, and your change is gone. Copy what you need into your own file instead.

Your own files

Your own files are never touched by a skill, a refresh or an upgrade. npx mdlake ownership shows who owns what.

FolderWhat goes thereAlso needed
src/pages/A whole page at its own addressNothing. The file name is the address.
src/layouts/Your layoutlayout in site.config.ts
src/components/Your modules and componentsmodules in site.config.ts for a module

Create site.config.ts when you need it. Everything you do not name in it still comes from the kit.

What can go wrong

SymptomCause and fix
A search of the repository finds nothingThe part is in the kit or the lake. Use the table above.
A change in node_modules disappearedInstalling restores the kit. Register your own file instead.
plan-to-config says a file was edited by handSomeone changed a generated file. Read the summary, then keep the edit by adopting the file, or run the script again with --overwrite. See Ownership zones.
Text is still the old text after publishingThe site has not been built since. Run a new build, or the refresh-content skill in snapshot mode.
Your new file has no effectIt is not registered in site.config.ts, or astro dev was not restarted after you registered it.

What’s next