Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for extra args to github-pages docker #753

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions contrib/func.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env sh
# The github-pages function optionally takes two arguments
# - the first argument is the path to the Jekyll site
# - the second argument is the port number
# The github-pages function optionally reads two environment variables
# - the first is the path to the Jekyll site (GH_PATH)
# - the second is the port number (GH_PORT)

function github-pages {
_path=${1:-.}
_port=${2:-4000}
_path=${GH_PATH:-.}
_port=${GH_PORT:-4000}
docker run --rm \
-p $_port:4000 \
-u `id -u`:`id -g` \
-v `realpath $_path`:/src/site \
gh-pages
gh-pages jekyll serve -H 0.0.0.0 -P 4000 $@
}