diff options
Diffstat (limited to 'pelican-compile.sh')
-rwxr-xr-x | pelican-compile.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/pelican-compile.sh b/pelican-compile.sh new file mode 100755 index 0000000..ac3d478 --- /dev/null +++ b/pelican-compile.sh | |||
@@ -0,0 +1,46 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | ## | ||
3 | # This section should match your Makefile | ||
4 | ## | ||
5 | PY=${PY:-python} | ||
6 | PELICAN=${PELICAN:-pelican} | ||
7 | PELICANOPTS= | ||
8 | |||
9 | BASEDIR=$(pwd) | ||
10 | INPUTDIR=$BASEDIR/content | ||
11 | OUTPUTDIR=$BASEDIR/output | ||
12 | CONFFILE=$BASEDIR/pelicanconf.py | ||
13 | |||
14 | ### | ||
15 | # Don't change stuff below here unless you are sure | ||
16 | ### | ||
17 | |||
18 | SRV_PID=$BASEDIR/srv.pid | ||
19 | PELICAN_PID=$BASEDIR/pelican.pid | ||
20 | |||
21 | function usage(){ | ||
22 | echo "usage: $0" | ||
23 | echo "This compiles the pelican site in the current directory," | ||
24 | echo "using ./pelicanconf.py as configuration file," | ||
25 | echo " ./content as input directory," | ||
26 | echo " ./output as output directory (overwriting it)." | ||
27 | exit 3 | ||
28 | } | ||
29 | |||
30 | function compile(){ | ||
31 | echo "Compiling" | ||
32 | shift | ||
33 | rm -r $OUTPUTDIR | ||
34 | $PELICAN $INPUTDIR -o $OUTPUTDIR -s $CONFFILE $PELICANOPTS | ||
35 | } | ||
36 | |||
37 | ### | ||
38 | # MAIN | ||
39 | ### | ||
40 | |||
41 | if [[ $1 == "help" ]]; then | ||
42 | usage | ||
43 | else | ||
44 | compile | ||
45 | fi | ||
46 | |||