Previous
Config General
Overdog's directory structure is built on the philosophy of "Convention over configuration." This approach dictates that each template file is named index.twig
and resides within a path of directories that represent its section type and handle, starting from the templates/_sections
directory.
/templates
├── _abstracts # Contains font-face declarations and webpack generated files.
│ ├── critical # Critical CSS files, specific for the homepage.
├── _base # Base layout templates including headers, footers, etc.
├── _macros # Twig macro files for reusable code snippets.
├── _navigation # Templates for navigation bars and menus.
├── _sections # Section-specific templates, categorized by type.
│ ├── single # Folder for Single entries.
│ │ ├── home # Example for 'singleHome' entry type.
│ │ │ └── index.twig
│ │ └── news # Example for 'singleNews' entry type.
│ │ └── index.twig
│ ├── channel # Folder for Channel entries.
│ │ ├── events # Example for 'channelEvents', each entry's template.
│ │ │ └── index.twig
│ │ └── news # Example for 'channelNews', each entry's template.
│ │ └── index.twig
│ ├── structure # Folder for Structure entries (add subfolder based on the handle).
│ ├── category # Folder for categories with associated templates.
├── components # Reusable components like a pagination.
│ └── pagination.twig
├── 404.twig # Template for 404 error page.
├── sitemap.xml.twig # Sitemap template, customizable for the project.
└── robot.txt # Instructions for web crawlers.
Note: Prepending folders with an underscore (_
) prevents direct web access to these folders.
Folder structure follows a naming convention that combines the name of the handle.
In addition to templates, the project is structured with src
and config
directories for managing assets and configurations.
/src
├── ejs # EJS templates used by Webpack.
├── js # JavaScript files.
├── css # Custom Tailwind CSS files.
└── svg
└── sprite-images # Source SVG files to be included in the sprite.
/config
├── project # Automatically generated YAML files for admin structure.
├── redactor # Custom configurations for the Redactor text editor.
└── general.php # General project configuration file.