hugosoucycc

[ARCHIVED] Another old source code of <hugo.soucy.cc>.
Log | Files | Refs | Submodules

commit f9be4a3ab2aa27d498b5a5c21f0c0cbfbe0fc04c
parent a83c31f18751580abc2b749d16127d1372367afc
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sat,  6 Aug 2016 17:01:17 -0400

Remove `.sh` extension.

Diffstat:
Rfunctions/build-pandoc-templates.sh -> functions/build-pandoc-templates | 0
Rfunctions/clean-content-folder.sh -> functions/clean-content-folder | 0
Rfunctions/create-html-pages.sh -> functions/create-html-pages | 0
Rfunctions/create-html-sections.sh -> functions/create-html-sections | 0
Rfunctions/get-archetypes.sh -> functions/get-archetypes | 0
Rfunctions/get-pandoc-templates.sh -> functions/get-pandoc-templates | 0
Rfunctions/get-static-files.sh -> functions/get-static-files | 0
Rfunctions/move-html-to-publichtml.sh -> functions/move-html-to-publichtml | 0
Apanstash | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dpanstash.sh | 69---------------------------------------------------------------------
10 files changed, 69 insertions(+), 69 deletions(-)

diff --git a/functions/build-pandoc-templates.sh b/functions/build-pandoc-templates diff --git a/functions/clean-content-folder.sh b/functions/clean-content-folder diff --git a/functions/create-html-pages.sh b/functions/create-html-pages diff --git a/functions/create-html-sections.sh b/functions/create-html-sections diff --git a/functions/get-archetypes.sh b/functions/get-archetypes diff --git a/functions/get-pandoc-templates.sh b/functions/get-pandoc-templates diff --git a/functions/get-static-files.sh b/functions/get-static-files diff --git a/functions/move-html-to-publichtml.sh b/functions/move-html-to-publichtml diff --git a/panstash b/panstash @@ -0,0 +1,69 @@ +#!/bin/bash +# +# PANSTASH - Yep! An Other Static Website Generator! +# (Pandoc + Mustache + Bash) +# + +# Dependencies : +# * Pandoc - Make sure it's installed on your machine : `$ pandoc -v`. +# * Mustache - Is already includes in pantash : `lib/mo/`. + +# Maybe i should call it «FAKESTASH» !? «FAKESTASH SSG». + +# Include the main configuration file +. config/config.sh + +# Include mustache for bash +. lib/mo/mo + +# Include parse_yaml function +. lib/parse_yaml.sh + +# Include all the main functions +. functions/get-archetypes +. functions/build-pandoc-templates +. functions/get-pandoc-templates +. functions/move-html-to-publichtml +. functions/create-html-pages +. functions/create-html-sections +. functions/get-static-files +. functions/clean-content-folder + +get_archetypes + +if [[ -n "$1" ]] && [[ " ${archetypes[*]} " == *" $1 "* ]] && [[ -n "$2" ]]; then + # Should be more dynamic with regex. + # Don't suppose of the file format. + + # Build the archetype's title from 2nd argument + # It'll work if the format is "this-is-my-new-conten.md" + dynamictitle=$(echo "$2" | tr '-' ' ' | sed -r 's/.md//g') + + archetype_title=${dynamictitle^} + archetype_date=$NOW_DATE + archetype_datetime=$NOW_DATETIME + + mo $ARCHETYPES_PATH/$1.md > $CONTENT_PATH/$1/$2 + + echo "- The file '$CONTENT_PATH/$1/$2' hab been created." +else + # Check if Pandoc is installed. + if hash pandoc 2>/dev/null; then + # Ok Pandoc is here. + # Execute main functions + build_pandoc_templates + create_html_pages + create_html_sections + get_static_files + clean_content_folder + + echo "- Your New Website Is Ready Here : $PUBLICHTML_PATH/ . Thanks Pandoc!!" + + exit 0 + else + echo "- Sorry But You must Install *Pandoc* For Using *Panstash*." + echo "- Please Visit <http://pandoc.org/installing.html>." + + exit 1 + fi +fi diff --git a/panstash.sh b/panstash.sh @@ -1,69 +0,0 @@ -#!/bin/bash -# -# PANSTASH - Yep! An Other Static Website Generator! -# (Pandoc + Mustache + Bash) -# - -# Dependencies : -# * Pandoc - Make sure it's installed on your machine : `$ pandoc -v`. -# * Mustache - Is already includes in pantash : `lib/mo/`. - -# Maybe i should call it «FAKESTASH» !? «FAKESTASH SSG». - -# Include the main configuration file -. config/config.sh - -# Include mustache for bash -. lib/mo/mo - -# Include parse_yaml function -. lib/parse_yaml.sh - -# Include all the main functions -. functions/get-archetypes.sh -. functions/build-pandoc-templates.sh -. functions/get-pandoc-templates.sh -. functions/move-html-to-publichtml.sh -. functions/create-html-pages.sh -. functions/create-html-sections.sh -. functions/get-static-files.sh -. functions/clean-content-folder.sh - -get_archetypes - -if [[ -n "$1" ]] && [[ " ${archetypes[*]} " == *" $1 "* ]] && [[ -n "$2" ]]; then - # Should be more dynamic with regex. - # Don't suppose of the file format. - - # Build the archetype's title from 2nd argument - # It'll work if the format is "this-is-my-new-conten.md" - dynamictitle=$(echo "$2" | tr '-' ' ' | sed -r 's/.md//g') - - archetype_title=${dynamictitle^} - archetype_date=$NOW_DATE - archetype_datetime=$NOW_DATETIME - - mo $ARCHETYPES_PATH/$1.md > $CONTENT_PATH/$1/$2 - - echo "- The file '$CONTENT_PATH/$1/$2' hab been created." -else - # Check if Pandoc is installed. - if hash pandoc 2>/dev/null; then - # Ok Pandoc is here. - # Execute main functions - build_pandoc_templates - create_html_pages - create_html_sections - get_static_files - clean_content_folder - - echo "- Your New Website Is Ready Here : $PUBLICHTML_PATH/ . Thanks Pandoc!!" - - exit 0 - else - echo "- Sorry But You must Install *Pandoc* For Using *Panstash*." - echo "- Please Visit <http://pandoc.org/installing.html>." - - exit 1 - fi -fi