summaryrefslogtreecommitdiff
path: root/pelican-compile.sh
blob: ac3d478e7018a617329e3b07b58d80c594b6a150 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
##
# This section should match your Makefile
##
PY=${PY:-python}
PELICAN=${PELICAN:-pelican}
PELICANOPTS=

BASEDIR=$(pwd)
INPUTDIR=$BASEDIR/content
OUTPUTDIR=$BASEDIR/output
CONFFILE=$BASEDIR/pelicanconf.py

###
# Don't change stuff below here unless you are sure
###

SRV_PID=$BASEDIR/srv.pid
PELICAN_PID=$BASEDIR/pelican.pid

function usage(){
  echo "usage: $0"
  echo "This compiles the pelican site in the current directory,"
  echo "using ./pelicanconf.py as configuration file,"
  echo "      ./content as input directory,"
  echo "      ./output as output directory (overwriting it)."
  exit 3
}

function compile(){
  echo "Compiling"
  shift
  rm -r $OUTPUTDIR
  $PELICAN $INPUTDIR -o $OUTPUTDIR -s $CONFFILE $PELICANOPTS
}

###
#  MAIN
###

if [[ $1 == "help" ]]; then
 usage
else
 compile
fi