From 95d70c492fcc8e1f44098bfe7041d31893b8d7f0 Mon Sep 17 00:00:00 2001 From: Christopher Orr Date: Sun, 24 Jan 2021 15:49:05 +0100 Subject: [PATCH 1/2] Update dev builds to enable incremental building plus live reload. The `--host` flag always throws an "invalid option" error for me with both Jekyll 3 or 4, and listening on 0.0.0.0 appears to be the default anyway (at least for me when running in Docker). --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2f51cc82e..c3abad1eb 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "bitwarden-help", "version": "0.0.0", "scripts": { - "build": "gulp build && jekyll build", - "build:watch": "gulp build && jekyll serve --watch --host=0.0.0.0", + "build": "gulp build && jekyll build --incremental", + "build:watch": "gulp build && jekyll serve --incremental --watch --livereload", "build:prod": "gulp build && cross-env JEKYLL_ENV=production jekyll build", "build:prod:sub": "gulp build && cross-env JEKYLL_ENV=production jekyll build --config _config.yml,_config-sub.yml" }, From 40299d728cfedf22e25a906bc49057038d931e73 Mon Sep 17 00:00:00 2001 From: Christopher Orr Date: Sun, 24 Jan 2021 15:58:53 +0100 Subject: [PATCH 2/2] Add instructions for building and testing the site with Docker. --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b27a47396..beaf4ce5b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,23 @@ Run the following commands: - `npm install` - `npm run build:watch` -You can now access the help center at `http://localhost:4009`. +You can now access the help center at `http://localhost:4009`. As soon as you save any changes, Jekyll will compile them and automatically reload the page in your browser. + +## Docker + +Alternatively, you can build and test the site without installing Node.js, Ruby etc. on your machine. + +Assuming you have Docker installed, you can run this setup command: +``` +docker run --rm -t -i -v $(PWD):/srv/jekyll jekyll/jekyll:4 npm install +``` + +Then run this command to build and serve the site: +``` +docker run --rm -t -i -v $(PWD):/srv/jekyll \ + -p 4009:4009 -p 35729:35729 jekyll/jekyll:4 \ + npm run build:watch +``` # Ruby Gems