aboutsummaryrefslogtreecommitdiff
path: root/share/templater/pelican/setup
blob: 93375ada544d90091997842dc1cfe9c47f88fc65 (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
#!/bin/bash
#
# Pelican templater module.
#

# Parameters
SHARE="$1"

# Include basic functions
source $SHARE/templater/functions || exit 1

# Pelican implementation
function templater_pelican {
  if [ ! -e "pelicanconf.py" ]; then
    __templater_echo "Setting up pelican..."

    #__templater_checkout_develop
    __templater_copy_or_append pelican .gitignore

    cp $SHARE/sphinx/files/pelicanconf.py .

    if [ ! -e "Makefile" ]; then
      cp $SHARE/pelican/files/Makefile .
    #elif ! grep -q pelican Makefile; then
    #  grep -v '^#' $SHARE/pelican/files/Makefile >> Makefile
    else
      cp $SHARE/ikiwiki/files/Makefile Makefile.pelican
    fi

    if [ ! -d "content" ]; then
      cp -r $SHARE/pelican/files/content .
    fi
  else
    __templater_echo "Pelican already set"
  fi
}

# Dispatch
templater_pelican