How to organize your first website project: files, folders and naming
When you start building websites, it's tempting to put everything in one folder with names like final2.html. A little structure from the start makes projects easier to maintain and deploy.
A simple structure for a static site:
my-site/
index.html
about.html
css/
styles.css
js/
main.js
images/
logo.svg
team-photo.jpg
README.md
Naming tips:
- Use lowercase and hyphens instead of spaces:
contact-us.html, notContact Us.html. Many servers are case-sensitive, and spaces cause messy URLs. - Name your homepage
index.html; servers usually show it by default. - Use descriptive image names (
red-bicycle.jpg, notIMG_4821.jpg), which also helps accessibility and search.
Linking files:
- Use relative paths like
css/styles.cssso the site works locally and when deployed. - Keep CSS in external files rather than inline styles scattered through HTML.
- Load JavaScript with
deferin the<head>or at the end of the body.
Good habits:
- Put the project under Git from day one.
- Add a
.gitignorefor system files and anything private. - Write a short README explaining what the project is and how to run it.
As projects grow, frameworks bring their own conventions, but these basics still apply.
How do you organise your projects? What naming mistake has caused you problems later?
Comments · 4
Lowercase names with hyphens and no spaces avoid trouble with URLs. Also, name the entry file index.html.
An images folder and a css folder from day one is plenty for a beginner. Don't overbuild the structure.
Should I use Git from the start even on a tiny personal site?
Yes, definitely. Git works great on a tiny site, and the habit of committing before you try something risky saves you.