This is the website for Savas Labs.
The site is built using Jekyll and Gulp.
- Bundler:
gem install bundler
- Jekyll:
gem install jekyll
- node.js and npm. For npm, you should be running at least major version 3. To update npm to the latest version, run
npm install npm@latest -g
. - Gulp:
npm install -g gulp
- ImageMagick:
brew install imagemagick
- Proselint:
pip install proselint
- Aspell:
_scripts/aspell.sh
. This script will install and configure Aspell.
- Clone the repo (default branch is
source
; do not use master.) - Run
git config core.hooksPath hooks
. This configures git to use hooks inside thehooks
directory instead of.git/hooks
. - Run
bundle install
(orbundle install --path vendor/bundle
if preferred) - Run
npm install
to install node modules. This takes a few minutes.
Use the gulp serve
command to serve the site locally and watch for file
changes. Initially, or anytime you want to rebuild the _site
directory, you
should run gulp serve --rebuild
, which will run the local build task before
serving the site.
gulp serve
uses the test and dev config files for local development.
If needed, run npm install
to install any modules that were added since you
last served the site.
Thanks to gulp.watch
and BrowserSync, any changes you make will trigger Gulp
to either regenerate the Jekyll site and automatically refresh your browser or,
if they're changes to CSS or images, inject the updated file(s) so a refresh
isn't needed. It's pretty cool!
You can toggle some options in the gulpfile:
- In the
serve
task, changeghostMode
totrue
if you want to mirror clicks, reloads, etc. across browsers. Useful for testing, hard on performance. - In the
serve
task, changeopen
tofalse
if you don't want BrowserSync to automatically open a browser window for you when you serve the site. - TODO: allow devs to use the
--drafts
tag to show works in progress. For now you can update the build command in thebuild:jekyll:local
task to include the--drafts
tag.
To avoid optimizing images each time the site is built, locally or in Travis,
we're committing optimized images to the _assets
directory. When you add a
new image, be sure to run gulp optimize:images
to optimize the new image. When
you commit an image, the pre-commit hook will remind you to do this.
Because we're using Travis to build the site and push to master, which is then
deployed by GitHub Pages, the master branch contains the generated _site
directory. The main development branch you should pull from and open pull
requests against is source
.
The pre-commit hook located in the hooks
directory does the following on all staged HTML and markdown files:
- Checks spelling with Aspell
- Runs markdown-lint (mdl)
- Runs proselint
To add words to the custom dictionary:
- Add the words to
savas_wordlist.txt
(one word per line) - Run
_scripts/aspell.sh
to update the dictionary.
To ignore the tests and commit (only recommended for proselint errors):
- Run
git commit --no-verify
To run the tests:
$ bash _scripts/run-tests.sh
Visit our style guide to read about how to construct a blog post and the standards we follow at Savas Labs.
Comments are handled by a Dockerized instance of Squabble. Please refer to that repositories README for notes on usage, and to the wiki page for production deployment information.