Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to organise my web content?

What is the most common way to organise web content, i.e. HTML, JS and CSS?

I'm usually doing this for small projects:

  • index.html
  • style.css
  • script.js

I think this is fairly standard. But how do you do it for projects with more than one HTML/JS file? My approach is:

  • index.html
  • foobar.html
  • style.css
  • js
    • core.js
    • foobar.js

Is this a common way of doing it? Should I move CSS to a separate "css" directory even if there's only one file? How is this central CSS file usually called? "style.css" or "base.css" or something else? Is it common to move HTML files to a separate directory?

like image 809
futlib Avatar asked Mar 31 '11 13:03

futlib


People also ask

What is powerful tools for organizing the content of Web page?

Google Sheet and Docs If you love distraction-free writing, then google, then using Google Docs is best for you. Although it is not technically distraction-free, it facilitates its users to get going on writing without having to bargain with much past some clicks.

How the content of a website is organized is called?

But one step in the Web development process is often skipped over or forgotten altogether: content planning. Sometimes called information architecture” or “IA planning”, this step doesn't find a home easily in many people's workflow.


2 Answers

That's pretty much a matter of taste.

However it's pretty common to put all your js/css and static images into a single folder like /static or /media. So for example /media/css/style.css. The point here is that you'll often develop dynamic pages using a application server (Ruby on Rails, Django) and want to serve the static content using a light weighted webserver like nginx.

You may want to have a look at http://html5boilerplate.com/ which contains most of the current best practises.

like image 91
hynek Avatar answered Oct 05 '22 12:10

hynek


I do this:

index.html
styles/
    main.css  # Main CSS
    i/        # CSS images dir. Its name is short because: background:url(i/my_image.png);
    f/        # CSS fonts dir.
scripts/
    main.js   # Main JS
images/       # Content images
like image 29
bpierre Avatar answered Oct 05 '22 12:10

bpierre