Project structure
This page provides an overview of the file and folder structure of an Ontario.ca Frontend project. It covers top-level files and folders, as well as items found within the src
directory.
Top-level folders
Name | Description |
---|
src | Application source folder |
node_modules | Application dependencies (automatically generated) |
Top-level files
Name | Description |
---|
package.json | Project dependencies and scripts |
.eleventy.js | Configuration file for Eleventy |
.eslintrc.js | Configuration file for ESLint |
.prettierrc.json | Configuration file for Prettier |
.prettierignore | Files and folders that Prettier will ignore |
.htmlvalidate.json | Configuration file for html-validate |
.htmlvalidateignore | Files and folders that html-validate will ignore |
.nvmrc | Configuration file for Node Version Manager |
src
folders
Name | Description |
---|
_data | Files containing global data available to every page or layout template in a project |
_includes | Files containing layout templates, partials and macros to be consumed by project pages |
assets | Files and folders containing styles, images and scripts in a project, including Ontario Design System assets |
tests | Files and folders containing unit, integration, and end-to-end tests. |
src
files
Name | Description |
---|
index.njk | Convenience page redirecting browsers to a project’s default English-language page during local development |
<my-english-page>.njk | Default English-language page created during the new project setup process |
<ma-page-francaise>.njk | Default French-language page created during the new project setup process |
sitemap.njk | File to help search engines find, crawl, and index a project’s pages (necessary for deploying to Ontario.ca) |