Sveltin Project Structure
Sveltin uses a set of conventions over configuration to simplify the expirience without losing flexibility and don’t repeat yourself.
A Sveltin app will have a number of generated files and folders that make up the structure of the project. Here is a basic rundown on the function of each of the files and folders Sveltin creates by default.
A Sveltin project looks like this:
my-project/ ├ config/ │ └ [autogenerated and your own config files] ├ content/ │ └ [your markdown files] ├ src/ │ ├ lib/ │ │ └ [autogenerated and your own files] │ ├ params/ │ │ └ [autogenerated and your own matchers] │ ├ routes/ │ │ └ api │ │ │ └ [autogenerated] │ │ └ [autogenerated and your own routes] │ ├ app.html │ ├ app.css ├ static/ │ └ [your static assets] ├ themes/ │ └ [autogenerated] │ │ └ [your components and partials] ├ mdsvex.config.js ├ package.json ├ svelte.config.js ├ sveltin.json ├ tsconfig.json └ vite.config.ts
|sveltin.json||The main config file for your Sveltin based project. It is uded to share info across multiple parts of the project as well as is read by the CLI when running commands.|
|config||Accessible across the codebase as $config. The following files are autogenerated:
|src||In SvelteKit powered apps, src is where you app lives. The folder structure is the same as any other SvelteKit project. Sveltin takes care to autogenerate subfolders and files when using the CLI commands.
|themes||Accessible across the codebase as $themes. Contains the folder structure for your theme as described just below.
|themes/<t>||Supposing that t is your theme name. The following folders and files are autogenerated:
|static||Contains static files and compiled assets with stable URLs.
When Sveltin builds your site, all assets are copied over as-is.
Other files like mdsvex.config.js, svelte.config.js, vite.config.ts etc. are generated by Sveltin when scaffolding the project, setting a zero-config approach to get started and move on.
Last updated: 17-Feb-2023