From 96ac64dd99864809308abb80e6fdc003441b9f8a Mon Sep 17 00:00:00 2001 From: Eric Herman Date: Wed, 27 Sep 2023 11:52:38 +0200 Subject: [PATCH] add script/serve.sh Co-authored-by: Jan Ainali --- README.md | 2 +- script/serve.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 script/serve.sh diff --git a/README.md b/README.md index 6cab461..bd2f7a8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This project is meant internally for the Foundation for Public Code as we try to This theme is built to run predictably on GitHub pages, therefore the [`github-pages`](https://github.com/github/pages-gem) gem is required. Run `bundle install` before building with Jekyll. -To serve locally with Jekyll, use `bundle exec jekyll serve`. +To serve locally with Jekyll, use `script/serve.sh` ## Customising diff --git a/script/serve.sh b/script/serve.sh new file mode 100755 index 0000000..a026509 --- /dev/null +++ b/script/serve.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: 2019-2023 The Foundation for Public Code + +# The serve.sh script can be used to preview how Jekyll will build the site. + +# if PAGES_REPO_NWO is not set then default to publiccodenet/jekyll-theme +# (jekyll defaults to "origin" if a remote of that name exists, +# which makes sense for a true fork, but not for most contributors) +if [ "_${PAGES_REPO_NWO}_" == "__" ]; then +export PAGES_REPO_NWO=publiccodenet/jekyll-theme +fi + +bundle exec jekyll serve --livereload