CIS86 2007 Site Mechanics
Here are some notes about the mechanics of Web sites.
Recommended Directory Structure for Web sites:
- Web sites are typically placed in a hierarchical directory structure. The top of that hierarchy, called the root,
contains the "home page" of the site -- the default page that is returned when you request the site by domain name only,
without specifying an actual HTML page.
- When a user requests a Web page only by the domain name, the Web server must decide which HTML page should be returned.
The server looks for either index.html or default.html, and returns the first one it finds. If PHP is in use, the Web server may
also look for index.php and default.php if the HTML files were not located in the root directory.
- It is a good practice to cluster similar things in subdirectories under the site's root. At the least, you should consider creating
a CSS subfolder to hold CSS and Javascript files, and an images subfolder to hold the images used on your site. By moving these
files below the root folder, you can get at your HTML files more quickly and cleanly.
Local vs Remote
The typical model of working with a Web site is to have the Master site files on your hard drive, and then place a
copy of the Master site on a Web server (another computer). Using manual (FTP) or automated (GoLive) means, you can then
synchronize the master site with the copy of the site on your Web server. When testing your site, you can either test directly
from your hard drive, or you can upload the files to your Web server for testing. If you don't use any server-side technologies
like PHP, then reading the HTML from your hard drive is exactly like reading the HTML from the Web server.
WYSIWYG vs Code View
Web pages are just text files, so you can use a plain text editor. All of the HTML formatting is created with textual markups of the underlying text, but the markup is itself text. The cleanest code you'll ever see is hand-written in a text editor -- most HTML code generated by WYSIWYG (What You See Is What You Get) systems is bloated and poorly formatted. A text editor knows little or nothing about the domain, though, and so can do little assist you (checking syntax, avoiding need to retype things) with creating HTML code.
- Macintosh: TextEdit comes with current versions of OSX. If you don't find it in the Dock, look in Finder > Applications. It can open and display PC docs such as MS Word. It can save files in these formats: rtf html doc xml.
- PC: Notepad or Wordpad can be used to edit all text files, including HTML files
Using a Web Development System (GoLive or Dreamweaver)
There are several advantages to using a Web Development system like GoLive or Dreamweaver. Normally, you create the files for your Web site on your own computer, and simply upload the pages to the Web server whenever you change them.
- The system can manage the synchronization of your Web site automatically.
- You can choose to design your pages in WYSIWYG mode, thereby reducing your need to know HTML. A graphical
interface can also automate or facilitate certain tasks by understanding the task.
- The system can validate links for you, and check your spelling and your HTML syntax.
- You can use templates to create a bunch of similar pages, allowing you to update all pages by changing the template.
- NOTE: We have an atypical environment at the College, since you don't have private computers. You can either: (1) use your student directory on the class Web server as the primary version of your files, and then just work on copies locally at whatever machine you find yourself using; (2) use the same computer throughout the semester, allowing you to store your files locally on the hard drive. This also allows GoLive to remember your settings -- otherwise you'll have to re-enter this info each time you use a different computer.
- Just So You Know: I use Dreamweaver as my Web development environment. It is greatly superior to GoLive (especially the ancient version the College has installed). Adobe agrees -- they bought Macromedia to get Dreamweaver and Flash. Expect to see GoLive go the way of the dodo bird.