Who this is for. A developer who knows application frameworks and has just cloned a Core dna site's repository. Afterwards you will know where each kind of file belongs, where to look for the things a repository like this does not contain, and which of its files the site will hand to anyone who asks.
The first-day tour is The shape of a theme repo; this page is the reference behind it.
What is not in it
A theme repository has no controllers, no models, no migrations and no routing table. The platform matches a URL to a record, its controller loads the record and assigns it to the template, and the record's layout names the template file. Your repository decides how the result looks, and nothing else runs from it on the server. When you look for the usual parts, this is where they are:
| You look for | On Core dna |
|---|---|
| Routes | The platform's module routes plus each record's slug or custom URL, set in the admin. Redirects are rewrites, also in the admin. |
| Controllers | The platform's. A template receives what they assign: What the controller hands the template. |
| Models and migrations | Content types, layouts, layout areas, custom entity types and custom fields, configured in the admin or through the API. A change to them is a change to records, not a deploy. |
| Server-side logic | Jobs (the Orchestration module, formerly Hooks), and custom endpoints built from synchronous jobs. |
| Configuration | Settings in the admin: System › Global Settings and each module's own settings. |
Older repositories can still carry an index.php, loose PHP files or a modules/ folder from an earlier version of the platform. The platform neither runs nor serves them. Do not add to them, and do not delete them until someone has confirmed what they were for.
The folders
| Folder or file | What belongs in it |
|---|---|
templates/ | Every Smarty or Twig template, laid out by module: pages/pages/, blogs/posts/, components/, includes/, errors/. Read by the platform when it renders; never served as a file. |
src/ | Authored front-end source: SCSS, JavaScript or TypeScript, fonts and design images. Its inner layout varies: src/app/{js,scss}, src/static/{js,scss} and src/{js,scss} are all in use. |
dist/, static/ or build/ | The build output, committed: Source and build output. |
assets/ | Files served as they are, outside the build: a vendored script, per-brand images, a font you do not process. |
translations/ | XLIFF files that replace or add interface strings: Translation files in the theme repo. |
.build/, config/ or the root | Build configuration: webpack.common.js and its siblings, or config/gulp.js. |
failover/, on some sites | A static page for when the site cannot answer: Maintenance and failover pages. |
| The root | package.json and its lock file, robots.txt, favicons, a README, and on some sites .static-assets.json and .settings.json. |
A site's .settings.json overrides settings made in the admin: the platform reads it after the database and lets it win. Some repositories track it, for example to set the template engine. Keep anything secret out of it: What must never be committed.
What the web can reach
The platform serves a file from the repository at its own path, dist/app.css as /dist/app.css, when its extension is on this list: