-
Install
node.jsandnpm, the node package manager.-
I suggest you use
nvm(the node version manager) or installnode.jsfrom source. Theapt-getpackages are fairly old.
-
-
Join the
ops-classgroup 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 installis running and performing some local compilation. Note that you also need ImageMagick installed locally to build the node packages.sudo apt-get install libmagick++-devdoes the trick on Ubuntu 14.04.
-
-
make run, then openlocalhost:8080in your browser. -
When you edit, rerun
makeand the site will be rebuilt.make checkwill build and check the site. -
I suggest a three terminal environment using
tmux:-
An editing window.
-
A window to run
makeormake check. -
A window to run
make runto serve the sources.
-
-
make checkruns 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.jsonfile 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.orgwill 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.