fakestache-ssg

[Archived] A static site generator in Bash 4.
Log | Files | Refs | Submodules | README

commit b08a742203177763b2dd6c352e8db0b1485c25a3
parent 23a9cc8eecfdfd03f53221a21e930cf0216bdc3d
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Tue,  1 Nov 2016 15:35:08 -0400

Enhance file création trough archetypes.

Diffstat:
Mfakestache | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/fakestache b/fakestache @@ -28,7 +28,7 @@ get_archetypes # Reset all variables that might be set -reset= +reset=false case $1 in "${archetypes[*]}") @@ -36,6 +36,7 @@ case $1 in archetype_title="$2" archetype_date=$NOW_DATE archetype_datetime=$NOW_DATETIME + archetype_template="$1" remove_whitespace=${archetype_title// /-} remove_quote=${remove_whitespace//\'/-} @@ -43,9 +44,9 @@ case $1 in archetype_filename=${remove_capitalletter}.md - mo $ARCHETYPES_PATH/$1.md > $CONTENT_PATH/$1/"$archetype_filename" + mo $ARCHETYPES_PATH/$1.md > $CONTENT_PATH/$1/"${NOW_DATE:0:4}"/"${NOW_DATE:5:2}"/"$archetype_filename" - echo "- The file '$CONTENT_PATH/$1/$archetype_filename' hab been created." + echo "- The file '$CONTENT_PATH/$1/${NOW_DATE:0:4}/${NOW_DATE:5:2}/$archetype_filename' hab been created." exit 0 else echo "- ERROR: Requires a second argument! You need a title to create a $1." >&2 @@ -58,7 +59,7 @@ case $1 in case $2 in -r|--reset) reset=true - ;; + ;; esac ;; -r|--reset) @@ -66,10 +67,10 @@ case $1 in case $2 in -d|--dev) - BASE_URL=$SITE_URL_DEV + BASE_URL=$SITE_URL_DEV ;; esac - ;; + ;; esac if hash pandoc 2>/dev/null; then