aboutsummaryrefslogtreecommitdiff
path: root/share/templater/hugo/setup
blob: 8f9ce06eb88ae70399060b6a16b324d980d7c42e (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
#!/bin/bash
#
# Hugo templater module.
#

# Parameters
SHARE="$1"

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

# Hugo implementation
function templater_hugo {
  if [ ! -e "config.toml" ]; then
    templater_echo "Setting up Hugo..."

    if which hugo &> /dev/null; then
      hugo new site .
    else
      templater_echo "Hugo not available, please install it, skipping"
    fi
  else
    templater_echo "Hugo already set"
  fi
}

# Dispatch
templater_hugo