A static Jekyll site for the DPC welcome, FAQ, and documentation pages.
It is assumed that the environment already has these installed:
- rbenv or rvm to install versioned ruby.
- ruby currently using 2.7.1
- jekyll currently using 4.2.0
- npm currently using 6.13.4
- Docker to standardize builds across all contributors' local machines
- Docker Compose to define and run multi-container Docker applications
Navigate to the repository and install the appropriate Gem file and package.json
file.
(A Gem file includes the dependencies for Ruby apps.)
gem install bundler
<— install Gem bundlerbundle install
<— install Gem bundlesnpm install
<— installpackage.json
dependenciesmake install-git-hooks
<— install git-hook(s)
Jekyll builds the CSS and HTML pages. Run bundle exec jekyll serve
from the project root for a local build. By default, the site will run in http://localhost:4000/
. You can also run bundle exec jekyll build
to compile the site files into the _site
directory.
Every contributor that uses Docker will have the exact same build as every other contributor. The command for a consistent and simple build process is:
docker-compose -f docker-compose.yml build static_site
docker-compose -f docker-compose.yml run --rm static_site
This process uses a Docker container to execute bundle exec jekyll build
, compiling site files into the same _site
directory used when executing this command on the Docker host. The advantage here is that there's no need to install ruby or any dependencies on the machine building the static site—Docker takes care of all that.
To host the site in Docker, accessible at http://localhost:4001/
:
docker-compose run --publish 4001:4000 --rm --entrypoint "bundle exec jekyll serve -H 0.0.0.0" static_site
This is a convenience meant to ease integration of static site builds with the larger DPC CI/CD pipeline.