hugosoucycc

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

commit 6900b3f9a29a0dcbf6966bec3ccd9910b7a0dbbf
parent 63aba1276de820a1f5e78aed67ebb38c896fcd41
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Fri,  5 Aug 2016 14:31:03 -0400

Reduce th width of the pandoc lines.

Diffstat:
Mfunctions/create-html-pages.sh | 23++++++++++++++++++-----
Mfunctions/create-html-sections.sh | 15++++++++++++---
2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/functions/create-html-pages.sh b/functions/create-html-pages.sh @@ -10,7 +10,8 @@ create_html_pages () { get_pandoc_templates # Create the homepage - pandoc --template=$TPL_PANDOC_PATH/index.html -o $CONTENT_PATH/index.html $CONTENT_PATH/index.md + pandoc --template=$TPL_PANDOC_PATH/index.html \ + -o $CONTENT_PATH/index.html $CONTENT_PATH/index.md # Then create others for markdown in $(find $CONTENT_PATH/ -mindepth 2 -type f -name \*.md); do @@ -39,16 +40,28 @@ create_html_pages () { # Check if the date property value is not "null" if [[ "$config_date" != "null" ]]; then - pandoc -s $markdown --template=$TPL_PANDOC_PATH/${section}.html --variable=modified:$(date -r $markdown +%Y-%m-%dT%H:%M:%S) --variable=permalink:$BASE_URL/$section/$pagepath.html -o $(dirname "$markdown")/$pagepath.html + pandoc -s $markdown \ + --template=$TPL_PANDOC_PATH/${section}.html \ + --variable=modified:$(date -r $markdown +%Y-%m-%dT%H:%M:%S) \ + --variable=permalink:$BASE_URL/$section/$pagepath.html \ + -o $(dirname "$markdown")/$pagepath.html else - pandoc -s $markdown --template=$TPL_PANDOC_PATH/${section}.html -o $(dirname "$markdown")/${outputname%.*}.html + pandoc -s $markdown \ + --template=$TPL_PANDOC_PATH/${section}.html \ + -o $(dirname "$markdown")/${outputname%.*}.html fi else if [[ "$config_date" != "null" ]]; then - pandoc -s $markdown --template=$TPL_PANDOC_PATH/default.html --variable=modified:$(date -r $markdown +%Y-%m-%dT%H:%M:%S) --variable=permalink:$BASE_URL/$section/$pagepath.html -o $(dirname "$markdown")/$pagepath.html + pandoc -s $markdown \ + --template=$TPL_PANDOC_PATH/default.html \ + --variable=modified:$(date -r $markdown +%Y-%m-%dT%H:%M:%S) \ + --variable=permalink:$BASE_URL/$section/$pagepath.html \ + -o $(dirname "$markdown")/$pagepath.html else - pandoc -s $markdown --template=$TPL_PANDOC_PATH/default.html -o $(dirname "$markdown")/${outputname%.*}.html + pandoc -s $markdown \ + --template=$TPL_PANDOC_PATH/default.html \ + -o $(dirname "$markdown")/${outputname%.*}.html fi fi done diff --git a/functions/create-html-sections.sh b/functions/create-html-sections.sh @@ -32,7 +32,11 @@ create_html_sections () { url=$(find $PUBLICHTML/ -type f -name ${outputname%.*}.html;) # Create all the includes files that make up section page and put them into the "includes" folder - pandoc $markdown -s --variable=url:$BASE_URL/${url#*/} --template=$TPL_PANDOC_PATH/"$tplname"-index.inc.html -t html5 -o $indexsubdir/includes/$markdown_date-$markdown_datetime-${outputname%.*}.inc.html + pandoc $markdown -s \ + --variable=url:$BASE_URL/${url#*/} \ + --template=$TPL_PANDOC_PATH/"$tplname"-index.inc.html \ + -t html5 \ + -o $indexsubdir/includes/$markdown_date-$markdown_datetime-${outputname%.*}.inc.html done if test "$(ls -A "$indexsubdir/includes/")"; then @@ -40,10 +44,15 @@ create_html_sections () { sorted_includes=$(find $indexsubdir/includes/ -type f -name \*.inc.html | sort -nr) # Create an HTML file with all the includes in descending order - pandoc -t html5 $sorted_includes -o $indexsubdir/includes/includes.html --parse-raw + pandoc -t html5 $sorted_includes \ + -o $indexsubdir/includes/includes.html \ + --parse-raw # Merge the "includes.html" and "index.md" to create the section page list - pandoc -t html5 $indexsubdir/index.md -s --template=$TPL_PANDOC_PATH/"$tplname"-index.html -A $indexsubdir/includes/includes.html -o $indexsubdir/index.html + pandoc -t html5 $indexsubdir/index.md -s \ + --template=$TPL_PANDOC_PATH/"$tplname"-index.html \ + -A $indexsubdir/includes/includes.html \ + -o $indexsubdir/index.html # Remove the temporary "includes" folder and all his content rm -Rf $indexsubdir/includes/