fakestache-ssg

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

commit 91a1d016b40fac506137c09a45f9bfa94fc72c18
parent bb253c00acdeaea1d79ead4b643ff88c1db7d0d8
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Tue,  1 Nov 2016 21:21:31 -0400

Add the database processing

For the lists of contents.

Diffstat:
Mfunctions/create-html-pages | 19++++++++++++++++---
Mtemplates/pandoc/.gitignore | 1-
Dtemplates/pandoc/fakestache.db.md | 1-
3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/functions/create-html-pages b/functions/create-html-pages @@ -19,7 +19,7 @@ create_html_pages () { false) find_noindex_markdown=$(find "$CONTENT_PATH/" -mindepth 2 -type f -name \*.md -mtime -1) ;; - esac + esac # Then create others for markdown in $find_noindex_markdown; do @@ -34,7 +34,7 @@ create_html_pages () { # page_path="$year"/"$month"/"${outputname%.*}" # Get the relative path of the markdown file - page_path="$(realpath --relative-to=$CONTENT_PATH $markdown)" + page_path="$(realpath --relative-to=$CONTENT_PATH $markdown)" # Check if a section have a specific template or use the default template if [[ " ${templates[*]} " == *" $templatename "* ]]; then @@ -51,7 +51,20 @@ create_html_pages () { --variable=permalink:"$BASE_URL/${page_path%.*}" \ -o "$(dirname "$markdown")/${outputname%.*}.html" fi - done + echo "$config_date$config_datetime|$BASE_URL/${page_path%.*}|$config_title" + done > fakestache.tmp.db + + sort -nr fakestache.tmp.db > fakestache.db + + while read BLOGITEM; do + ITEM1=`echo $BLOGITEM | cut -d "|" -f 1` + ITEM2=`echo $BLOGITEM | cut -d "|" -f 2` + ITEM3=`echo $BLOGITEM | cut -d "|" -f 3` + + echo $ITEM1 + + done < fakestache.db + move_html_to_publichtml } diff --git a/templates/pandoc/.gitignore b/templates/pandoc/.gitignore @@ -2,4 +2,3 @@ * # Except those files !.gitignore -!fakestache.db.md diff --git a/templates/pandoc/fakestache.db.md b/templates/pandoc/fakestache.db.md @@ -1 +0,0 @@ -$date$T$datetime$ ;; $permalink$ ;; $title$