-
Notifications
You must be signed in to change notification settings - Fork 85
Folder Structure
The following highlights key files and folders you're likely to use in ChromeOS.dev's folder structure, with explanations following.
.
├── patches
├── functions
├── lib
│ ├── collections
│ ├── filters
│ ├── gulp
│ ├── helpers
│ ├── linting
│ │ └── schemas
│ ├── markdown
│ └── transforms
├── site
│ ├── _data
│ ├── _generated
│ │ └── _components
│ ├── _components
│ ├── _layouts
│ ├── {{langcode}}
│ │ └── {{langcode}}.11tydata.js
│ │ └── _data
│ ├── public
│ ├── js
│ │ ├── animation
│ │ ├── components
│ │ ├── lib
│ │ ├── worklets
│ │ ├── main.js
│ │ └── search-worker.js
│ ├── sass
│ │ ├── components
│ │ ├── globals
│ │ │ └── extends
│ │ ├── layouts
│ │ └── style.scss
│ ├── manifest.json
│ └── sw.json
├── tests
│ ├── fixture
│ ├── helpers
│ └── {{tests}}
├── .eleventy.js
├── vite.config.js
├── package.json
├── ava.config.cjs
├── vrt.js
└── firebase.json
The functions folder is home to our Firebase function code.
The lib folder contains scripts that get used as part of our build process. Files in the collections and filters folders are automatically found and included in our Eleventy build process. The markdown folder includes our Markdown compiling configuration and project-specific plugins, the helpers folder contains shared functionality across our build process, the linting folder contains linting helpers, especially for our Markdown and Schema linting, and the transforms folder contains HTML transformations.
The site directory is where all source code for the website goes. It has the following primary folders:
- The
_datadirectory is where global data files are stored. - The
_generatedfolder contains templates that get output multiple times based on variables using Eleventy's pagination functionality. This is especially used for generating localized versions of generic and data-drive pages (as opposed to content-drive pages) and shared components (in the_componentsfolder) like the global header and footer - The
_componentsfolder (calledincludesin Eleventy documentation) and the layouts in the_layoutsfolder contain reusable templating for 11ty. See Eleventy's Nunjucks documentation for more information on how they work together. - There are folders named after ISO 639-1 language codes (such as
enandes). These folders contain the internationalized content for that given language code. Each of these folders (in the tree named as{{langcode}}) must have a_datafolder and corresponding{{langcode}}.11tydata.jsfile in order internationalization to properly work. -
manifest.jsonwhich is the site's web app manifest -
sw.jswhich is the Service Worker -
jscontains the site's JavaScript-
main.jswhich is the main JavaScript entry point for the site -
search-worker.jswhich a web worker for offline search -
animationsfolder holds Lottie animation information -
componentsfolder holds browser JavaScript components -
libfolder holds helpers to use across browser JavaScript -
workletsfolder holds worklets, like those used in the CSS Paint API
-
-
sasscontains the site's styling-
style.scsswhich is the main Sass entry point for the site -
globalsfolder holds Sass shared across all files (but shouldn't write any CSS itself) -
componentsfolder holds individual component styling - layouts` folder holds styling for individual layouts. Components and layouts should match their corresponding templates
-
The tests folder contains tests and test helpers. The fixture folder contains test fixtures to use throughout testing, the helpers folder contains code to help when testing. Other folders in the tests directory are for grouping of like tests together and are not significant to the overall test hierarchy.
Build system and test config files, .eleventy.js, vite.config.js, ava.config.cjs, vrt.js