getlantern / www.getlantern.org

Superseded by https://github.com/getlantern/www
GNU General Public License v3.0
115 stars 25 forks source link

[Depreciated by https://github.com/getlantern/www]

build status Code Climate

This is the code that powers https://www.getlantern.org.

OS X Quick Start

For easy copy/paste into Terminal:

# install homebrew if missing
which brew || ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

# install git if missing
which git || brew install git

# clone the repo and cd into it
git clone https://github.com/getlantern/www.getlantern.org.git
cd www.getlantern.org

# install npm if missing
which npm || brew install npm

# install required global node packages
npm install -g grunt-cli bower

# s3_website tool for deploying to S3
gem install s3_website

# install required local node packages
npm install

# install required bower packages
bower install

# install compass if missing
which compass || sudo gem install compass

# start up the development web server
grunt serve

# setup and start ghost blog
cd blog && npm install && bower install && npm start

Dependencies

Tools

This site is built with the following tools:

Before jumping in, it's worth taking some time to get familiar with any of these you may not have used before.

Development

To start up a development session using grunt's default dev server, run "grunt serve". That will start watching the source files, start the dev server, open a browser pointing to the dev server, and detect when any source files are changed and automatically compile any reload them in the browser.

Please note that the current deployment has to prepend "./" to image URLs to get around the getlantern.org subdirectory on our S3 mirror at https://s3.amazonaws.com/getlantern.org/index.html. The unfortunate result of this is that those images fail to load in local testing even though they'll load no problem in production.

i18n

Translated strings are fetched from json files in the "app/locale" directory and interpolated into the app using Angular Translate. To add or change a translated string, update the corresponding mapping in "app/locale/en_US.json" and add or update any references to it in the app if needed.

Transifex

All translatable content for Lantern has been uploaded to [the Lantern Transifex project](https://www.transifex.com/projects/p/lantern/] to help manage translations. Translatable strings from this code have been uploaded to the www resource therein. Transifex has been set up to automatically pull updates to that resource from its GitHub url (see http://support.transifex.com/customer/portal/articles/1166968-updating-your-source-files-automatically for more information).

After translators add translations of these strings to the Transifex project, the Transifex client can be used to pull them. See http://support.transifex.com/customer/portal/articles/996157-getting-translations for more.

Creating a production build

Run "grunt build" when ready to locally preview a production build of the site. This should lint-check the code, run the automated tests, then compile, minify, concatenate, and otherwise modify source files for production. The resulting built site will be output to the "dist" directory. You can cd into it, run "python -m SimpleHTTPServer", and then point a browser at the local built version to make sure it looks the same as the development version.

Please note that the current deployment has to prepend "./" to image URLs to get around the getlantern.org subdirectory on our S3 mirror at https://s3.amazonaws.com/getlantern.org/index.html. The unfortunate result of this is that those images fail to load in local testing even though they'll load no problem in production.

Deployment

Run "grunt deploy". This will create a fresh build in the "dist" directory and then deploy it to our S3 bucket that serves both our S3 mirror as well as getlantern.org.