Directory Structure

From Dreamwidth Notes
Jump to: navigation, search

This documents the contents of the $LJHOME development folder as present on all Dreamhacks.


Backend utilities for maintaining and upgrading the site.

Commonly used programs in this directory include:

Subdirectories are:






Code libraries that power the site. This directory is the base of the library path--that is use Net::OpenID::Consumer; refers to the code in cgi-bin/Net/OpenID/ It contains all the custom Perl libraries and functions that the code references including the LJ::* and DW::* libraries.

All subdirectories here map to library names, so DW::Foo goes in cgi-bin/DW/ and so forth.

Code in *.pl files in this directory are also library files but in an older style that haven't been converted over to use .pm. These are described in Legacy .pl Files.


Original LJ modules.


Newer, DW-based modules.


Unedited versions of some configuration files are stored here, plus the DocBook manual.


Docbook formatted source for the old and very much out of date docbook code for the LiveJournal server. LiveJournal's version is visible at but Dreamwidth has not generated a user-visible copy.


Various configuration files such as These serve as examples of a prototypical site only; actual running sites should set up local config files in ext/local.

To add new items to be configured, see cgi-bin/LJ/Global/


This directory contains any local repository checkouts--for instance, dw-nonfree, Dreamwidth's non-open source code, goes here. The directory structure in dw-nonfree is parallel to the root directory structure -- that is, it contains folders such as htdocs, cgi-bin, bin, though not all folders are present.

This directory also contains local config files in ext/local/etc, so they won't be affected by source code updates.


User-facing BML pages, with the directory structure used on the main website. That is to say, anything that appears at will be here, as htdocs/filename.bml; anything at will be here as htdocs/directory/filename.bml, etc.

We are in the process of translating these files into controllers, found in cgi-bin/DW/Controller/, and templates, found in views.


JavaScript files. Files not under the folders listed below are considered legacy and are only around because they're being used on older (unconverted) pages. They shouldn't be touched to add new features, only to fix (critical) bugs.


Reusable components that can be used across pages


The Foundation library files. Don't touch.


The jQuery library files. Don't touch.


Per-page JS files. Directory structure should match that of views/ below. Try to keep to a minimum: should mostly be initialization of reusable components.


Older CSS files. To be converted to SCSS.



Styling for reusable components that can be used across pages.


The Foundation library files. As much as possible, don't touch. Try to make any changes to components/foundation-custom/*, to make it easier to upgrade if needed.


SCSS mixins that are meant to be included into other SCSS files as needed.


Per-page SCSS files. Directory structure should match that of views/ below. Try to keep per-page styling to a minimum, and instead use Foundation classes in your HTML when possible.


SCSS files for site skins. Contains actual skins as well as files that are included for all skins. Any color settings should only be in this folder.


Some of the Dreamwidth sub-systems keep log files here, including the journal importer.


Template Toolkit (*.tt) files for generating the site schemes used on Dreamwidth.


Source code for some of the third-party packages the code uses.


Tests that use the testing framework in main/test. See Dev Testing for how to use them.


Used by the doc system ( Which means basically unused right now.


Template Toolkit files which are gradually replacing the BML files. The controllers for the templates are in cgi-bin/DW/Controller/.


Reusable components. See the the style guide for examples of how to call them.