U.S. Department of Energy - Energy Efficiency and Renewable Energy

Communication Standards and Guidelines

File Naming Conventions and Directory Structure

Background

File and directory naming conventions are key to creating a well-organized site. Organization provides many benefits, not the least of which is helping your visitors navigate your site.

  • Web users often try to guess or remember URLs. A consistent directory structure helps people to intuitively navigate. For example, if they can find news for the solar site under http://www.eere.energy.gov/solar/news/, they are likely to try the same URL under geothermal, e.g., http://www.eere.energy.gov/geothermal/news/.

  • When sites are well organized up front, directory and file names are less likely to change down the road, avoiding broken links and bookmarks.

  • Site managers benefit from an organized structure when it comes time to determine ownership of files and clean up directories in order to keep pages current. New managers can easily learn the structure.

  • Consistent structure and well-named files help developers when performing maintenance. Files they need to update are easily found, even if they are not familiar with that technology.

  • A well-organized site structure can help site managers get more out of their statistics packages by providing more specific reporting on subsections of data.

Goals

  • Encourage the use of clear and mnemonic filenames.

  • Promote a level of consistency in naming that will foster a relatively intuitive access to files and Web space.

  • Ease management and maintenance.

Specific Guidelines

  • Use separate subdirectories for major subsites or content categories linked from the main site, as in www.eere.energy.gov/femp/procurement/index.html.

  • Note that URLs, file names, and file extensions cannot contain uppercase letters, spaces, or special characters (e.g., & or $), but may contain letters, numbers, underscores, and dashes.

  • Make sure that file names clearly denote their content; do not use the DOS 8-and-3 naming convention.

  • Make sure that static HTML file names end in .html or .shtml (when Server Side Include is in use), but not .htm.

  • Delete all extraneous, nonlinked (orphan) files. Developers outside of the NREL Web team will delete all extraneous files from the development server, and an NREL Web team member will then "mirror" the site. Mirroring copies any new files or files that were changed to the production server. It also removes any files from the production server that are no longer on the development server.

  • Archive superseded, but important, files.

General Guidelines

  • URLs must be as logical and clear as possible and make sense to people not familiar with EERE. Use unabbreviated words or common acronyms. They should be easy to remember and easy to spell: e.g., geothermal, not geothrm.

  • With that in mind, URLs should still be as short as possible: e.g., state_energy, not state_energy_program. Longer URLs are harder for people to remember and type and are often broken when sent through e-mail (An e-mail allows about 70 characters per line).

  • Avoid overly general file and directory names (e.g., file1.html, file2.html). File names should be based on the page title.

  • URLs should contain only lowercase letters, numbers, and the underscore character (never use spaces).

    • Use numbers only if there is a compelling reason to do so, such as a date (e.g. not review3.html but 09_02_newsletter.html).

  • The home page of a directory should always be named index.html (or index.shtml, index.cfm, etc.). This allows for shorter URLs as users can "chop off" the file name and still get to the page (e.g. eere.energy.gov/ defaults to eere.energy.gov/index.html)

  • Divide larger groups of files into subdirectories.

    • If you have several files in a directory called policy_lunch.html, policy_smoking.html, policy_sicktime.html, move them into a subdirectory called policy and call them lunch.html, smoking.html, sicktime.html

Directory Names for the 10 Programs

  • eere.energy.gov/biomass
  • eere.energy.gov/buildings
  • eere.energy.gov/femp
  • eere.energy.gov/vehiclesandfuels
  • eere.energy.gov/geothermal
  • eere.energy.gov/hydrogenandfuelcells
  • eere.energy.gov/industry
  • eere.energy.gov/solar
  • eere.energy.gov/wip
  • eere.energy.gov/windandhydro

Common Elements

If your site has a large number of files, consider using the following directories to help organize your content.

About the Program

program/
Information about people in the program, budgets and allocating, organizational charts and responsibilities, policy, mission, vision, success stories, outreach activities, plans, and contact lists.

Technologies

technologies/
Information about technologies the program supports.

Information Resources

resources/
Information about other resources available such as publications, software, CDs, and links.

Financial Opportunities

financial/
Information on all financial opportunities such as solicitations, RFPs, grants, and research subcontracts.

News

news/
Current program or industry news.

Events

events/
Information on any related conferences and events.

These four common files would live at the root of the program directories if appropriate.

  • webmaster.html
  • sitemap.html
  • subject_index.html
  • search.html

Periodicals

NOTE: This convention will depend on the frequency of publication.

Annually

annual_report/2000.html
annual_report/2001.html
annual_report/2002.html

Monthly

newsletter/2001/january.html
newsletter/2001/february.html

Weekly

newsletter/2001/0107.html
newsletter/2001/0114.html
newsletter/2001/0128.html

Daily

press_releases/2002/0112.html
press_releases/2002/0113.html