How to organize the root folder of a website correctly?

Asked

Viewed 513 times

-2

would like to know what is the pattern to be followed and the best way to organize the site files correctly, example I have a main folder that and the name of the site and within that folder I have a css folder,js,img,fonts

for every section of my website that I create (new .html file) should I create a css file and a js tbm? or I can use the msm js and css files for all the pages I create?

  • Your site will be static or dynamic?

  • face I have not started to study any language and back end so will be static

1 answer

0


This question is quite based on opinion, so you risk being closed soon.

For static websites, it is quite common for you to find the format:

├ audios/
├ css/
│   └ style.css
├ fonts/
├ images/
├ js/
│   └ main.js
├ vendor/
│   └ jquery/
│   └ bootstrap/
├ videos/
├ index.html

This is if you are not using any package management tool, such as npm, bower, or languages such as PUG, SASS, LESS, CooffeScript, TypeScript, etc. In such cases the organization of directories can change.

About CSS and JS files, it’s interesting that you keep everything in one file, to benefit from the browser’s cache system. On template images, such as icons that are not font based, it is interesting to do the Sprite.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.