#!/usr/bin/env bash # # The suspicious-looking install script for After Dark. # https://themes.gohugo.io/after-dark/ # # Copyright (c) 2016-2017 Josh Habdas (https://habd.as) # Licensed under WTFPL. You just DO WHAT THE FUCK YOU WANT TO. # # Exit early on failure set -e # Make some environment variables SITE_SOURCE_PATH=$(pwd) HUGO_CONFIG_PATH="./config.toml" # Create new After Dark site if [ -z "$1" ]; then SITE_SOURCE_PATH="${SITE_SOURCE_PATH}/flying-toasters" hugo new site flying-toasters && cd $_ else SITE_SOURCE_PATH="${SITE_SOURCE_PATH}/$1" hugo new site $1 && cd $_ fi echo "Installing After Dark ..." # Clone repo (cd themes; git clone -q --depth 1 https://github.com/comfusion/after-dark || { echo "cloning failed :/"; exit 1; }) # Copy archetypes cp themes/after-dark/archetypes/* ./archetypes # Ignore generated files from source control touch .gitignore echo " public resources " >> .gitignore # Add pretty config file with inline documentation tee $HUGO_CONFIG_PATH > /dev/null <