[Depreciated by https://github.com/getlantern/www]
This is the code that powers https://www.getlantern.org.
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
- node
- Global npm packages:
- yeoman
- grunt
- bower
- generator-angular (npm install -g yo grunt-cli bower generator-angular)
- For building stylesheets:
- For deploying to Nodejitsu:
- For deploying to S3:
- s3_website (gem install s3_website)
- For managing translations:
- Python 2.7 (comes with OS X)
- Transifex Client (pip install transifex-client)
- For running tests:
- PhantomJS (brew install phantomjs)
This site is built with the following tools:
- Yeoman
- Grunt
- Bower
- AngularJS
- AngularJS Yeoman Generator
- Angular Google Analytics
- Angular Translate
- Angular Translate Loader Static Files
- Compass
- Compass-Twitter-Bootstrap
- Transifex
Before jumping in, it's worth taking some time to get familiar with any of these you may not have used before.
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.
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.
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.
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.
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.