-
Install
node.js
andnpm
, the node package manager.-
I suggest you use
nvm
(the node version manager) or installnode.js
from source. Theapt-get
packages are fairly old.
-
-
Join the
ops-class
group on GitHub and add an SSH key. -
git clone [email protected]:ops-class/www.git
. If this doesn’t work, you probably don’t have a key installed. Return to Step 2. -
cd www; make install
-
The first time this will take some time since
npm install
is running and performing some local compilation. Note that you also need ImageMagick installed locally to build the node packages.sudo apt-get install libmagick++-dev
does the trick on Ubuntu 14.04.
-
-
make run
, then openlocalhost:8080
in your browser. -
When you edit, rerun
make
and the site will be rebuilt.make check
will build and check the site. -
I suggest a three terminal environment using
tmux
:-
An editing window.
-
A window to run
make
ormake check
. -
A window to run
make run
to serve the sources.
-
-
make check
runs several sets of build-time checks:-
Broken links by
metalsmith-linkcheck
. Broken external links will not fail the build but will generate a warning Broken internal links will. -
Formatting checks by
metalsmith-formatcheck
. Format failures will fail the build, but I doubt you’ll be changing the format much. -
Spelling checks by
metalsmith-spellcheck
. Spelling failures will halt the build. -
I maintain all three of these Metalsmith plugins, so if you find bugs let me know.
-
-
If the build doesn’t complete, fix the problems and rerun make. Don’t push until the build completes.
-
Please check the
links_failed.json
file if it complains. Sometimes external broken links are a transient problem, but at least check to make sure that you understand what is failing. -
To add spelling exceptions see the documentation for
metalsmith-spellcheck
. There are a bunch of ways to do this depending on the word that is being marked as misspelled. -
Commit your changes to
master
. -
Push to
master
. This triggers remote testing on Travis CI. It runsnpm test
, which in our case runsmake check
. If that does not fail, the sources onwww.ops-class.org
will be updated. This sometimes takes a few minutes. -
If the build fails you should receive an email. The main site will not update. Please fix the problem and push again.