hugosoucycc

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

commit d282286168f9ea69f495fcff8c9fb4b6282bf64c
parent 0c3dd952b6d09b1577a75cae981ea60baea79b5f
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Thu, 15 Jun 2017 15:22:14 -0400

Fix the problem with meta vars

Diffstat:
Mfunctions/create-html-pages | 21++++++++-------------
Mfunctions/create-html-sections | 9+++++++++
2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/functions/create-html-pages b/functions/create-html-pages @@ -11,7 +11,7 @@ create_html_pages () { local page_title=$title local description="$description" - local keywords="$keywords" + local keywords="$keywords" # Convert markdown to html local main_content=$(make_html_from_md "$CONTENT_PATH/index.md") @@ -33,6 +33,9 @@ create_html_pages () { # Get the relative path of the markdown file local page_path="${markdown#$CONTENT_PATH}" + unset -v cite + unset -v citeurl + # Load the meta file of the markdown . "${markdown%.*}.meta" @@ -42,8 +45,10 @@ create_html_pages () { local modified="$(date -r "$markdown" +%Y-%m-%dT%H:%M:%S)" local templatename="$template" local permalink="$BASE_URL${page_path%.*}.html" - local description="$description" - local keywords="$keywords" + local description_loc="$description" + local keywords_loc="$keywords" + local cite_tpl="$cite" + local citeurl_tpl="$citeurl" # Convert markdown to html local main_content="$(make_html_from_md "$markdown")" @@ -58,22 +63,12 @@ create_html_pages () { mo "$TPL_MUSTACHE_PATH/default.mustache" > "$(dirname "$markdown")/${outputname%.*}.html" fi - unset description - unset 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 keywords - create_allpages move_html_to_publichtml - - unset description - unset keywords } diff --git a/functions/create-html-sections b/functions/create-html-sections @@ -16,6 +16,9 @@ create_html_sections () { # For each section page create a temporary "includes" folder mkdir -p "$TMP_PATH/$(basename "$indexsubdir")" + # Load the meta file of the subdirectory index + . "${indexsubdir%.*}/index.meta" + local page_title="$title" local tmp_folder="$TMP_PATH/$(basename "$indexsubdir")" @@ -33,6 +36,9 @@ create_html_sections () { # Get the relative path of the markdown file local page_path="${markdown#$CONTENT_PATH}" + unset -v cite + unset -v citeurl + # Load the meta file of the markdown . "${markdown%.*}.meta" @@ -43,6 +49,9 @@ create_html_sections () { local permalink=$(find "$PUBLICHTML/" -type f -name "${outputname%.*}".html;) local permalink="$BASE_URL/${permalink#*/}" + local cite_tpl="$cite" + local citeurl_tpl="$citeurl" + # Create all the includes files that make up section page and put them into the "includes" folder mo "$TPL_MUSTACHE_PATH/${tplname}-index.inc.mustache" > "$tmp_folder/$markdown_date-${outputname%.*}".inc.html done