File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 34
34
35
35
Now your site is deployed to ` gh-pages ` branch of your repo. Done.
36
36
37
- ## Comand Line Options
37
+ ## Command Line Options
38
38
39
39
Below is a list of all command line options.
40
40
@@ -44,6 +44,7 @@ Below is a list of all command line options.
44
44
| ` -b ` or ` --branch ` | The branch to push your site to. Defaults to ` gh-pages ` . If the branch does not exist, it will be created. |
45
45
| ` -r ` or ` --branch-from ` | The source branch. Defaults to ` master ` . |
46
46
| ` -c ` or ` --config ` | Name of the optional deploy config file. See [ Production variables] ( #production-variables ) below for more information. |
47
+ | ` -d ` or ` --drafts ` | Adds the ` --drafts ` option to Jekyll so that it will build draft posts. |
47
48
| ` -h ` or ` --help ` | Displays a list of all options. |
48
49
49
50
## Production variables
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ BRANCH=$2
8
8
BRANCH_FROM=$3
9
9
DEPLOY_CONFIG=$4
10
10
BUNDLE=$5
11
+ DRAFTS=$6
11
12
SRC=$( pwd)
12
13
TEMP=$( mktemp -d -t jgd-XXX)
13
14
trap " rm -rf ${TEMP} " EXIT
@@ -24,9 +25,9 @@ echo -e "\nBuilding Jekyll site:"
24
25
rm -rf _site
25
26
26
27
if [ -r ${DEPLOY_CONFIG} ]; then
27
- ${BUNDLE} jekyll build --config _config.yml,${DEPLOY_CONFIG}
28
+ ${BUNDLE} jekyll build --config _config.yml,${DEPLOY_CONFIG} ${DRAFTS}
28
29
else
29
- ${BUNDLE} jekyll build
30
+ ${BUNDLE} jekyll build ${DRAFTS}
30
31
fi
31
32
32
33
if [ ! -e _site ]; then
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Usage: jgd [options]
13
13
opt :branch_from , 'Source branch' , type : String , default : 'master'
14
14
opt :config , 'Deploy Config File' , type : String , default : '_config-deploy.yml'
15
15
opt :bundle , 'Use bundle'
16
+ opt :drafts , 'Generate drafts'
16
17
end
17
18
18
19
branch = opts [ :branch ]
@@ -23,11 +24,12 @@ fail 'branch-from can\'t be empty' if branch_from.empty?
23
24
fail 'config can\'t be empty' if config . empty?
24
25
url = opts [ :url ]
25
26
url = `git config --get remote.origin.url` . strip if url . empty?
26
- bundle = opts [ :bundle ] ? '"bundle exec"' : ''
27
+ bundle = opts [ :bundle ] ? '"bundle exec"' : '""'
28
+ drafts = opts [ :drafts ] ? '"--drafts"' : '""'
27
29
28
30
spec = Gem ::Specification . find_by_name ( 'jgd' )
29
31
root = spec . gem_dir
30
32
script = File . join ( root , 'bash/deploy.sh' )
31
33
32
34
fail 'deployment failed, see log above' \
33
- unless system ( "#{ script } #{ url } #{ branch } #{ branch_from } #{ config } #{ bundle } " )
35
+ unless system ( "#{ script } #{ url } #{ branch } #{ branch_from } #{ config } #{ bundle } #{ drafts } " )
You can’t perform that action at this time.
0 commit comments