]> gitweb.fluxo.info Git - templater.git/commitdiff
Implements jekyll and hugo
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 28 Oct 2017 10:16:29 +0000 (08:16 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 28 Oct 2017 10:16:29 +0000 (08:16 -0200)
templater

index 1c2aab66ae5759eb175beccc69d34e779b983c33..c2b20b89a933670ccd97272ecec91e7c3d28c1d1 100755 (executable)
--- a/templater
+++ b/templater
@@ -285,14 +285,32 @@ function templater_pelican {
 
 # Hugo implementation
 function templater_hugo {
-  echo "TODO: hugo"
-  true
+  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
 }
 
 # Jekyll implementation
 function templater_jekyll {
-  echo "TODO: jekyll"
-  true
+  if [ ! -e "_config.yml" ]; then
+    __templater_echo "Setting up Jekyll..."
+
+    if which jekyll &> /dev/null; then
+      jekyll new .
+    else
+      __templater_echo "Jekyll not available, please install it, skipping"
+    fi
+  else
+    __templater_echo "Jekyll already set"
+  fi
 }
 
 # Drupal7 implementation