summaryrefslogtreecommitdiff
path: root/pelican-compile.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pelican-compile.sh')
-rwxr-xr-xpelican-compile.sh46
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##
5PY=${PY:-python}
6PELICAN=${PELICAN:-pelican}
7PELICANOPTS=
8
9BASEDIR=$(pwd)
10INPUTDIR=$BASEDIR/content
11OUTPUTDIR=$BASEDIR/output
12CONFFILE=$BASEDIR/pelicanconf.py
13
14###
15# Don't change stuff below here unless you are sure
16###
17
18SRV_PID=$BASEDIR/srv.pid
19PELICAN_PID=$BASEDIR/pelican.pid
20
21function 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
30function 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
41if [[ $1 == "help" ]]; then
42 usage
43else
44 compile
45fi
46