# File Structure

## File Structure

**Skill level:** Everyone · **Time:** 5 minutes

### Inside The Theme Folder
You don't need to understand every folder. Most changes happen in the places marked in **bold** below.

<FileTree>

- lotline/
  - .cursor/
    - rules/
      - theme-architecture.mdc rules for the Cursor editor
  - .github/
    - copilot-instructions.md instructions for GitHub Copilot
  - .vscode/ recommended VS Code extensions and settings
  - .windsurf/
    - rules/
      - theme-architecture.md rules for the Windsurf editor
  - public/ files served as they are (favicons, the shared social image, and the `_headers` and `.htaccess` host settings)
  - scripts/ helper scripts behind the `npm run` commands
  - src/
    - assets/
      - images/
        - **lotline/** the demo photos, one folder per kind (heroes, properties, agents, areas, services, blog, and more), optimized at build time
        - icons/ social and Ask AI icons
        - logo.svg logo-on-dark.svg favicon.svg the Lotline mark as files
    - **config/** site-wide settings
      - config.toml site name, URL, agency details, listings, forms, layouts, SEO, cookies, motion
      - fonts.json fonts
      - language.json languages
      - menu.en.json header and footer links (English)
      - menu.fr.json header and footer links (French)
      - menu.ar.json header and footer links (Arabic)
      - social.json social media links
    - **content/** all text, images, and options
      - properties/ one file per home for sale or rent
        - english/
        - french/
        - arabic/
      - developments/ one file per new development
      - agents/ one file per agent
      - neighborhoods/ one guide per neighborhood
      - services/ one file per service
      - sections/ default content of every section
      - homepage/ the 3 homepages
      - reviews/ careers/ blog/ about-us/ contact/ faq/ one folder per page or collection
      - pages/ legal pages, valuation, how it works, reviews, and the two sample galleries
      - \_file_format.md every page frontmatter field, explained
    - i18n/ small interface text (button labels, form messages, footer text, SEO tagline)
      - en.json
      - fr.json
      - ar.json
    - layouts/
      - Base.astro the page shell (head, header, call to action, footer, cookie banner, scripts)
      - components/
        - sections/ one component per section
        - property/ the listing filters, facts, and photo gallery
        - cards/ property, agent, blog, and review cards
        - widgets/ smaller parts (page header, forms, cookie banner, mobile menu, Ask AI links)
        - global/ header, footer, logo
        - seo/ head tags
        - utilities/ images and the back-to-top button
      - helpers/ icon components
      - shortcodes/ components you can use inside MDX files
    - lib/ helper code (listings, prices, agency details, opening hours, structured data)
      - brandMark.ts the built-in logo mark
    - pages/
      - [...lang]/ **one file per route** (which sections a page shows, in which order)
      - robots.txt.ts builds `/robots.txt`
    - plugins/ build helpers
    - scripts/
      - motion.ts the scroll motion script
    - **styles/**
      - theme.css colors, type scale, breakpoints, radii
      - motion.css the scroll motion styles
      - rtl.css rules for right-to-left pages
      - navigation.css the header menus
      - base.css components.css … global styles
    - content.config.ts fields allowed in each collection
    - sections.schema.ts fields and layouts allowed in each section
  - AGENTS.md CLAUDE.md GEMINI.md SKILLS.md instructions and recipes for AI assistants
  - CHANGELOG.md what changed in each version
  - README.md requirements, commands, credits, and the "Before you launch" list
  - astro.config.mjs
  - netlify.toml vercel.json vercel.sh wrangler.toml hosting settings
  - package.json package-lock.json

</FileTree>

### The Three Layers
Lotline keeps three jobs apart. Knowing which layer you need saves a lot of searching:

| Layer       | Folder                        | Decides                                            | You edit it to…                          |
| ----------- | ----------------------------- | -------------------------------------------------- | ---------------------------------------- |
| **Content** | `src/content/`                | What the page says: text, listings, photos, links, options | Change copy, listings, buttons, layouts |
| **Pages**   | `src/pages/[...lang]/`        | Which sections a page shows and in which order     | Reorder, add, or remove sections         |
| **Design**  | `src/layouts/`, `src/styles/` | How each section looks and behaves                 | Change markup, styles, or behavior       |

Global settings sit beside them in `src/config/`.

### How Content Folders Are Named
Every content folder has one subfolder per language, and a few file name rules:

- `english/`, `french/`, and `arabic/` hold the same files. Each language reads only its own folder, so keep them in step when you add or rename a file. `npm run check-i18n` lists any file that exists in one language only.
- `-index.md` is the content of a list or landing page, for example `src/content/properties/english/-index.md` for `/properties/`.
- Every other file is one entry. Its name becomes the URL unless the file sets `customSlug`: `src/content/properties/english/elm-hill-modern-villa.md` is `/properties/elm-hill-modern-villa/`, and `src/content/agents/english/daniel-hart.md` is `/agents/daniel-hart/`.
- Listings point at agents and neighborhoods by file name (`agent: "daniel-hart"`, `neighborhood: "elm-hill"`). If you rename an agent or neighborhood file, update the listings that point at it.
- Files that start with `_` are ignored. `src/content/_file_format.md` explains the common page frontmatter fields. The full list is the `page` schema in `src/content.config.ts`.

<Aside type="note">
  `.astro/` and `dist/` are created for you when you run the site. Never edit
  them, because your changes would be overwritten.
</Aside>

### Path Shortcuts In Code
Component files import each other through shortcuts defined in `tsconfig.json`:

| Shortcut          | Real folder                 |
| ----------------- | --------------------------- |
| `@/components/*`  | `src/layouts/components/*`  |
| `@/shortcodes/*`  | `src/layouts/shortcodes/*`  |
| `@/helpers/*`     | `src/layouts/helpers/*`     |
| `@/*`             | `src/*`                     |

There is no `src/components/` folder: `@/components/sections/HeroSection.astro` is `src/layouts/components/sections/HeroSection.astro`.