hugosoucycc

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

commit a5a978b8a720200b028146878e4838591180b576
parent 956e6a4b33a07ab4790712ea586afe45ea7e043a
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Tue,  6 Jun 2017 21:12:07 -0400

Modify functions with a new shebang

Diffstat:
Mfunctions/build-pandoc-templates | 2+-
Mfunctions/clean-content-folder | 2+-
Mfunctions/create-feed | 2+-
Mfunctions/create-html-pages | 26+++++---------------------
Mfunctions/create-html-sections | 2+-
Mfunctions/get-archetypes | 2+-
Mfunctions/get-pandoc-templates | 2+-
Mfunctions/get-static-files | 2+-
Mfunctions/is-in-array | 2+-
Mfunctions/make-html-from-md | 2+-
Mfunctions/move-html-to-publichtml | 2+-
Mfunctions/parse-yaml | 2+-
12 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/functions/build-pandoc-templates b/functions/build-pandoc-templates @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Convert Mustache templates into Pandoc templates build_pandoc_templates () { diff --git a/functions/clean-content-folder b/functions/clean-content-folder @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Then remove those in the content folder clean_content_folder () { diff --git a/functions/create-feed b/functions/create-feed @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Create the Atom feed from the flat database create_feed () { diff --git a/functions/create-html-pages b/functions/create-html-pages @@ -11,15 +11,7 @@ create_html_pages () { local page_title=$title local description="$description" - local keywords="$keywords" - - if [ ! -z "$description" ]; then - has_description=true - fi - - if [ ! -z "$keywords" ]; then - has_keywords=true - fi + local keywords="$keywords" # Convert markdown to html local main_content=$(make_html_from_md "$CONTENT_PATH/index.md") @@ -53,14 +45,6 @@ create_html_pages () { local description="$description" local keywords="$keywords" - if [ ! -z "$description" ]; then - has_description=true - fi - - if [ ! -z "$keywords" ]; then - has_keywords=true - fi - # Convert markdown to html local main_content="$(make_html_from_md "$markdown")" @@ -75,21 +59,21 @@ create_html_pages () { fi unset description - unset has_description unset keywords - unset has_keywords echo "$date|$datetime|$BASE_URL${page_path%.*}.html|$page_title|$page_id" done | sort -nr -o "$FAKESTACHE_PATH"/"$DB" } create_homepage + unset description - unset has_description unset keywords - unset has_keywords create_allpages move_html_to_publichtml + + unset description + unset keywords } diff --git a/functions/create-html-sections b/functions/create-html-sections @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Create section page list create_html_sections () { diff --git a/functions/get-archetypes b/functions/get-archetypes @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Create an array with archtypes names get_archetypes () { diff --git a/functions/get-pandoc-templates b/functions/get-pandoc-templates @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Create an array with templates names get_pandoc_templates () { diff --git a/functions/get-static-files b/functions/get-static-files @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Rsync the static files into the public_html/ folder get_static_files () { diff --git a/functions/is-in-array b/functions/is-in-array @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash function is_in_array () { local e diff --git a/functions/make-html-from-md b/functions/make-html-from-md @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Create HTML files with the Markdown.pl script make_html_from_md () { diff --git a/functions/move-html-to-publichtml b/functions/move-html-to-publichtml @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Rsync all HTML files and folders to the public_html folder move_html_to_publichtml () { diff --git a/functions/parse-yaml b/functions/parse-yaml @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Source: https://gist.github.com/pkuczynski/8665367#file-parse_yaml-sh