Mozilla.org/How to Work with Site

From MozillaWiki
Jump to: navigation, search

Docs for people getting involved with site.

Asking Questions

The best way to learn about how to work with the www.mozilla.org site is to ask questions. Community members are happy to help, but it can be difficult to know who to talk to. Here are a few good places to go with questions:

Email: mozilla.dev.mozilla-org

Chat: #siteplanning on irc.mozilla.org

Phone: Monthly planning meetings

Bugzilla

We use Bugzilla to track bugs as well as enhancements to the site, so we recommend that you get familiar with this tool. You can look through bugs without a Bugzilla account, but you will need one to update an existing bug or open a new one. Please feel free to look through open bugs, comment in a bug, submit a patch or assign a bug to yourself.

Viewing The Source

The site uses a templating system to add the header, side navigation and footer to all of the pages. If you view the source of a page through your browser you are seeing the results of merging a page with a template. To see what the HTML files look like before they are merged, you can look at the files in our Subversion repository at:

Our repository is open, so feel free to look around at different files to see how things are put together.

Making Site Changes

There are several ways to edit the site and you are welcome to pick the option that works best for you.

Note: Most pages on the site are static HTML and can be edited directly, although there are some dynamic and generated pages that are not straight forward to edit. Feel free to contact us with questions about any specific page.

Submitting Patches

The easiest way to make a change is to work with someone who already has access to edit the site. You can send them the change in a variety of formats. Attaching a patch to a bug is the most common way to do that, but it is also possible to simply email a change to someone. How changes are submitted will vary on your technical experience and on who you are working with.

Using Bespin (Web-based Editor)

We will soon have a web-based editor available for the site. Our goal is to embed Bespin to make it easy for people to edit pages. When this is available, we'll post more information here about how to use it.

Using Subversion

The files for the site are kept in version control using the Subversion tool. You can edit the site by checking out these files, editing them on your computer and then checking them back in.

The following provides information specifically about Subversion for www.mozilla.org. General information about Mozilla's Subversion server is also available.

Repository

Note: mozilla.org is setup differently that most Mozilla web properties, so read this section closely before committing any code.

Both stage and production auto-update from svn. There is no traditional deployment process, so be careful.

Work locally, test in the stage branch, before merging to trunk (live).

Stage

Location of repository: http://svn.mozilla.org/projects/mozilla.org/branches/staging/

Production

Location of repository: http://svn.mozilla.org/projects/mozilla.org/trunk/

Authentication

Access to the repository is based on either your LDAP account or on an SSH key. People have reported problems trying to use SVN+SSH though, so LDAP authentication is the recommended option (the commands below are based on LDAP authentication).

If you need an SVN account or if you have one and need permission to edit the www.mozilla.org files, please file a bug to request access. For people without existing Mozilla commit rights, please follow the process described in becoming a committer.

Commands

To check out repository (note the use of the S in https://):

svn co https://svn.mozilla.org/projects/mozilla.org/trunk

Check-in an edit to a page:

svn ci -m "Comment goes here" foo.html

Staging Site

If you'd like to look at your changes before committing them to the live site, there are a couple of options—viewing things on our staging site or viewing them locally.

There is a staging site available at http://www-stage.mozilla.org. However, this isn't the best place to work on changes since the site is set up just to automatically pass on changes to the live site (this gives you a chance to check on things after committing a change to the repository).

Another staging option is to run a version of the site locally based on the files checked out from the repository. This set-up for your computer is documented below (note that we could use some help with making these instructions more user-friendly):

Localhost Site Setup

The following directions will show you how to setup a version of MozWeb (mozilla.org) on your local machine under the domain name mozilla.dev

Note: Once you are done with this guide, mozilla.dev should link to your local instance of MozWeb.

MAC OSX Setup

This setup was conducted on an Intel Mac running OS X 10.5.8 which was the latest version of Leopard at the time of this writing. 10.6 (Snow Leopard) has just come out but, this setup has not been tested on Snow Leopard.

If people could test the setup and give feedback for the setup on OS X 10.4+ (Tiger) and 10.6 (Snow Leopard)

Setup for Other Platforms

TODO: More Guides

More guides are coming for Windows and Ubuntu to help developers get up and running on hacking Mozweb.

Ubuntu

  • Do 1, 2 and optionally 3 from the instructions below
  • You need php5 and php5-curl installed ("sudo apt-get install php5 php5-curl")
  • You need to enable the "Actions" Apache module ("a2enmod actions")
  • You need to add "mozilla.dev" to the 127.0.0.1 line in /etc/hosts
  • You need a file in /etc/apache2/sites-enabled with the following contents:
<VirtualHost mozilla.dev:80>
   ServerName mozilla.dev
   DocumentRoot /path/to/your/checkout
   AddType application/x-httpd-php .php .html
   DirectoryIndex index.php index.html
   Options -Indexes

   RewriteEngine On
   RewriteMap toupper int:toupper
</VirtualHost>

Generic Setup

1) Check out trunk somewhere

2) Copy includes/config.inc.php-dist to includes/config.inc.php and edit appropriately

3) Add cronjob for front-page feed parser. Example would be:

*/10 * * * * root cd /data/www/www.mozilla.org/includes/; ./feed-parser.php -c ./feed-parser-config.xml

4) Add Apache vhost for site (example vhost is in README)

In the future we may change how staging works, but let us know if you have any questions about this current setup.

Style Guides and References

Once you're able to make changes to the site, please take a look at the following pages that offer suggestions about writing and coding. Since the site is edited by a range of people across the community, following some guidelines will help maintain a consistent experience for users.