Guidelines to help you align a microsite, partner website, or other affiliate content served to an audience under the MIT brand.
Content templates are located under /public/views/
, the Elements template uses /public/views/index.twig
.
- Home Brew (Mac):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
thenbrew doctor
- Node.js:
brew install node
or by downloading an installing from Nodejs.com - Bower for client-side package management:
npm install -g bower
- Open up the command line and change to a directory where you want to install the app:
cd ~/Sites
- Clone the repo to your machine:
git clone [email protected]:technologyreview/style-guide.git; cd style-guide
- Install Gulp:
npm install -g gulp
- Run the
gulp
command to build the project. This will install package dependencies usingnpm
andbowers
, and then start the local server - Open the browser to
http://localhost:9999
The production version of this style guide is hosted at Heroku and has two environments that can be deployed to using Git, staging
and production
.
- Development: localhost:9999 - Served locally by Gulp + Nodemon
- Staging: mittr-styleguide-staging.herokuapp.com
- Production: mittr-styleguide.herokuapp.com
To configure easy command-line deployment:
cd
to the repo directory on your machine:~/Sites/mittr-styleguide
- Download and install the Heroku Toolbelt
- Login to Heroku:
heroku login
with email[email protected]
and passwordtechRev1w0293057*
- Add the
staging
remote to Git for deploying changes to the staging Heroku environment:git remote add staging [email protected]:mittr-styleguide-staging.git
- Commit your changes, or merge them from another banch into master, and deploy them to Heroku staging:
git push staging master
- Add the
production
remote to Git for deploying changes to the production Heroku environment:git remote add production [email protected]:mittr-styleguide.git
- Commit your changes, or merge them from another banch into master, and deploy them to Heroku production:
git push production master
Notes on the tools and systems used.
- Gulp is used to automate build and compile processes
- Node.js is used for generating a micro HTTP server that serves routes and server-side JavaScript
- Express is a Node web app framework used for MVC routing
- Nodemon will monitor for any changes in your node.js application and automatically restart the server
- LiveReload is loaded by Gulp, and is used to for injecting CSS updates into the browser when a
/public/less/*.less
file is saved - Backbone.js
- Require.js for AMD
- Swig templating
- GitHub Flavored Markdown is automatically compiled when used in templates