# File Structure

## **File Structure**

After unzipping the theme, you will find a structure like this:

<FileTree>

- themes/
  - folex/ (📌 Main theme folder, the one with package.json)
- changelog.html (🔗 Links to online changelog)
- documentation.html (🔗 Links to online documentation)

</FileTree>

---

### **Main Theme Directory Structure**
This is the Astro edition. What differs in the Tina and Sanity editions is listed after the tree.

<FileTree>

- folex/
  - .cursor/
    - rules/
      - theme-architecture.mdc (Rules for Cursor)
  - .github/
    - copilot-instructions.md (Rules for GitHub Copilot)
  - .vscode/ (Recommended extensions and settings)
  - .windsurf/
    - rules/
      - theme-architecture.md (Rules for Windsurf)
  - public/
    - .htaccess (Headers for Apache)
    - \_headers (Headers for Netlify and Cloudflare Pages)
    - images/ (Favicons and gallery images)
    - plyr/ (Video player files)
    - videos/
    - umami.is.js
  - scripts/ (Favicons, languages, sitemap, config)
  - src/
    - \_\_tests\_\_/ (Unit tests)
    - assets/
      - images/
    - config/ (Site-wide settings)
      - config.toml (Global config)
      - fonts.json (Font definitions)
      - language.json (Language settings)
      - menu.en.json (English menu)
      - menu.fr.json (French menu)
      - menu.ar.json (Arabic menu)
      - social.json (Social links)
    - content/ (Content collections, one folder per language: english/, french/, arabic/)
      - about-us/ (About page content)
      - author/ (Blog author profiles)
      - blog/ (Blog posts)
      - contact/ (Contact page content)
      - faq/ (FAQ page content)
      - homepage/ (Homepage variants: digital agency, creative-agency, personal-portfolio, startup-agency)
      - pages/ (Static pages: privacy-policy, terms-conditions, elements)
      - portfolio/ (Portfolio projects)
      - pricing/ (Pricing page content)
      - sections/ (Default content of each section)
      - services/ (Services)
      - team/ (Team members)
      - \_file_format.md (Frontmatter reference)
    - i18n/ (UI string translations)
      - en.json (English)
      - fr.json (French)
      - ar.json (Arabic)
    - layouts/ (Page layouts & UI components)
      - components/ (Reusable UI elements)
        - cards/
        - global/
          - footer/ (FooterAi.astro, FooterCredit.astro)
          - header/ (Header.astro, Navbar.astro, MegaMenu.astro, NavStage.astro, LanguageSwitcher.astro, and more)
          - Footer.astro (Footer layout 1)
          - FooterTwo.astro (Footer layout 2)
          - FooterThree.astro (Footer layout 3)
          - Head.astro
          - Logo.astro
        - sections/ (Section components)
        - seo/
        - utilities/
        - widgets/ (contact form, subscription, offcanvas, search, etc.)
        - SinglePageLayout.astro
      - helpers/ (Icons.astro)
      - shortcodes/ (Custom MDX components: Accordion, Tabs, Notice, Testimonial, etc.)
      - Base.astro
    - lib/ (Shared utilities)
    - pages/ (Dynamic & static pages)
      - [...lang]/ (Multi-language support)
        - index.astro (Digital Agency homepage)
        - creative-agency.astro
        - personal-portfolio.astro
        - startup-agency.astro
        - about.astro
        - contact.astro
        - faq.astro
        - pricing.astro
        - blog/ (list, creative, single, category, tag, pagination)
        - portfolio/ (masonry, gallery, slider, full-width, single)
        - services/ (grid, two-column, accordion, single)
        - team/ (list, single)
        - [page].astro (Privacy policy, terms, elements, and your own pages)
        - 404.astro (Translated 404 page)
        - llms.txt.ts
        - llms-full.txt.ts
      - [...path].md.ts (Markdown copies of pages)
      - 404.astro
      - robots.txt.ts (robots.txt generator)
    - plugins/
      - odometer/ (Number animations)
    - styles/
      - animation.css
      - base.css
      - buttons.css
      - components.css
      - global.css
      - navigation.css
      - rtl.css
      - safe.css
      - theme.css
      - utilities.css
    - types/ (TypeScript definitions)
    - content.config.ts (Content collection schemas)
    - env.d.ts (Env variable types)
    - sections.schema.ts (Content options of the sections)
  - AGENTS.md (Instructions for AI assistants)
  - CHANGELOG.md
  - CLAUDE.md (Rules for Claude Code)
  - GEMINI.md (Rules for Gemini CLI)
  - README.md
  - SKILLS.md (Recipes for common jobs)
  - astro.config.mjs
  - netlify.toml
  - package.json
  - package-lock.json
  - vercel.json
  - vercel.sh
  - wrangler.toml

</FileTree>

<br />

Each folder under `src/content/` contains an `english/`, a `french/`, and an `arabic/` subfolder. Add or edit content inside the language folder you want to update.

### What Differs By Edition
**Tina** has everything above, and adds:

- `tina/`: the editor's setup. `tina/generated/collections.json` holds its forms.
- `scripts/tina/` and `scripts/cms/`: the commands behind `npm run dev`, `npm run tina:generate`, `npm run tina:audit`, and `npm run setup:tina`.
- `src/lib/tina/` and `src/layouts/components/tina/`: the live preview.
- `.env.example`, which lists the optional settings.

The listing files of the blog, portfolio, and services (`-index`), and the privacy policy and terms, are `.mdx` instead of `.md`, so the editor can show them.

**Sanity** has no `src/content/`, no `src/i18n/`, and no `src/config/menu.*.json`, because that content lives in your Sanity project. It adds:

- `sanity.config.ts`, `sanity.cli.ts`, and `sanity/`: your Studio.
- `sanity/seed/demo-content.json`: the bundled demo content.
- `scripts/sanity/`: the commands behind `npm run setup`, `npm run dev:all`, and the preview server.
- `src/lib/sanity/`, `src/sanity-routes/`, and `src/middleware.ts`: reading content and showing drafts.
- `.env.example`, which explains every variable.

---

#### Key Directories & Their Purpose

##### `/public` ⟶ Static Assets

- Stores favicons, videos, and other files that must be served as they are.
- Files inside this folder are accessible via direct URLs (e.g., `/images/favicons/favicon.svg`).

##### `/src` ⟶ Main Codebase

- Contains all Astro components, pages, content, and styles.
- A new entry in `src/content/` with only a title won't break the site, and it builds. Its card or page shows what you filled in, and images and other fields stay empty until you add them, so fill them in before you publish.
- Customize layouts, pages, and components here.

##### `/scripts` ⟶ Automation Scripts

- Optimizes workflows with utilities like:
  - `generate-favicons.mjs` → Generates favicons for all devices.
  - `generate-multilingual-content.mjs` → Adds a language, and scaffolds copies of your content to translate.
  - `remove-multilingual.mjs` → Removes every language except your default one.
  - `remove-draft-from-sitemap.mjs` → Removes pages with `draft: true` or `excludeFromSitemap: true` from the sitemap.
  - `toml-watcher.mjs` → Compiles `config.toml` into a generated JSON config used at build time.

---

#### ⚙️ Key Configuration Files

##### `astro.config.mjs` - Astro Configuration

- Manages integrations, build settings, and markdown processing.
- For general site settings, modify `config.toml` instead.

##### `config.toml` - Global Settings

The main settings file, `src/config/config.toml`. Each setting has a comment beside it.

<Aside type="note">
  In the Tina edition, you edit these under **Site settings** at `/admin/`. In
  the Sanity edition, most are under **Site settings** in the Studio, and a
  value there wins over the same value in this file. The language settings and
  folder names stay in this file.
</Aside>

| Table                               | Keys                                                                                                                                                                  |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[site]`                            | `title`, `description`, `tagline`, `taglineSeparator`, `baseUrl`, `logo`, `logoAlternate`, `logoText`, `logoWidth`, `logoHeight`, `trailingSlash`                     |
| `[site.favicon]`                    | `path`, `image`                                                                                                                                                       |
| `[seo]`                             | `author`, `keywords`, `robots`                                                                                                                                        |
| `[seo.robotsTxt]`                   | `enable`, `disallow`, `aiSearch`, `aiTraining`                                                                                                                        |
| `[seo.ai]`                          | `llmsTxt`, `markdownPages`                                                                                                                                            |
| `[seo.sitemap]`                     | `enable`, `exclude`                                                                                                                                                   |
| `[settings]`                        | `blogFolder`, `servicesFolder`, `portfolioFolder`, `pagination`, `stickyHeader`, `pageHeaderDefaultImage`, `contactFormAction`, `contactFormProvider`, `footerDescription` |
| `[settings.copyright]`              | `enable`, `text`                                                                                                                                                      |
| `[settings.subscription]`           | `enable`, `title`, `note`, `formAction`, `mailchimpTagValue`                                                                                                          |
| `[settings.multilingual]`           | `enable`, `defaultLanguage`, `disableLanguages`, `showDefaultLangInUrl`                                                                                               |
| `[settings.contactInfo]`            | `address`, `email`, `phone`                                                                                                                                           |
| `[settings.headerOffcanvas]`        | `enable`, `logo`, `description`, and `[settings.headerOffcanvas.button]` with `enable`, `label`, `url`                                                                |
| `[settings.smoothScroll]`           | `enable`, `respectReducedMotion`, `duration`, `easing`, `smoothWheel`, `syncTouch`, `wheelMultiplier`, `touchMultiplier`, `anchors`, `autoRaf`, `stopInertiaOnNavigate` |
| `[settings.themeCredit]`            | `enable`, `text`, `url`                                                                                                                                               |
| `[settings.pageActions]`            | `enable`, `footer`, `providers`                                                                                                                                       |
| `[settings.navigationButton]`       | `enable`, `label`, `url`                                                                                                                                              |
| `[settings.markup.tableOfContents]` | `enable`, `expanded`, `endLevel`, `ordered`, `startLevel`                                                                                                             |
| `[opengraph]`                       | `image`, `ogType`, `twitter`, `twitterCard`                                                                                                                           |
| `[head]`                            | `content`                                                                                                                                                             |

##### Styling & Fonts

- **Colors, breakpoints, and the type scale** live in `src/styles/theme.css`.
- **Fonts** are defined in `src/config/fonts.json` and loaded automatically.

#### Other Important Files

- **`package.json`** → Manages dependencies & npm scripts (`npm run dev`).
- **`netlify.toml` / `vercel.json` / `vercel.sh` / `wrangler.toml`** → Deployment settings for Netlify, Vercel, and Cloudflare Pages. See [Deployment](../../deployment/).

<br />

Now that you understand the project structure, it's time to customize the site's identity and logo.