Skip to content
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 $@
}