hugosoucycc

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

commit bfb1fdce95bfe7de1fdcef1674e571c70b1065f6
parent be89db97daceab1bd8ba74e6519a824afbce659e
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sun, 31 Jul 2016 15:23:03 -0400

Add modified date.

Diffstat:
Mfunctions/create-html-pages.sh | 6+++---
Mtemplates/mustache/default.mustache | 2+-
Mtemplates/mustache/note.mustache | 4++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/functions/create-html-pages.sh b/functions/create-html-pages.sh @@ -28,20 +28,20 @@ create_html_pages () { # First create year and month folders mkdir -p $(dirname "$markdown")/$year/$month - fi + fi # Check if a section have a specific template or use the default template if [[ " ${templates[*]} " == *" $section "* ]]; then # Check if the date property value is not "null" if [[ "$config_date" != "null" ]]; then - pandoc -s $markdown --template=$TPL_PANDOC_PATH/${section}.html -o $(dirname "$markdown")/$year/$month/${outputname%.*}.html + pandoc -s $markdown --template=$TPL_PANDOC_PATH/${section}.html --variable=modified:$(date -r $markdown +%Y-%m-%dT%H:%M:%S) -o $(dirname "$markdown")/$year/$month/${outputname%.*}.html else 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 -o $(dirname "$markdown")/$year/$month/${outputname%.*}.html + pandoc -s $markdown --template=$TPL_PANDOC_PATH/default.html --variable=modified:$(date -r $markdown +%Y-%m-%dT%H:%M:%S) -o $(dirname "$markdown")/$year/$month/${outputname%.*}.html else pandoc -s $markdown --template=$TPL_PANDOC_PATH/default.html -o $(dirname "$markdown")/${outputname%.*}.html fi diff --git a/templates/mustache/default.mustache b/templates/mustache/default.mustache @@ -13,7 +13,7 @@ <address class="layout"> <hr/> - <p><a class="note__link u-url u-uid u-syndication" href="#" rel="bookmark">#</a> Créé à {{ SITE_AUTHOR_LOCALITY }} le <time class="dt-published dt-updated" $if(datetime)$datetime="$date$T$datetime$"$endif$>$date$</time> par <a class="p-author author" href="{{ BASE_URL }}#hs" rel="author"><i>{{ SITE_AUTHOR }}</i></a>.<!-- <br/><a href="../../">Retour à la liste</a>. --> + <p><a class="note__link u-url u-uid u-syndication" href="#" rel="bookmark">#</a> Créé à {{ SITE_AUTHOR_LOCALITY }} le <time class="dt-published" $if(datetime)$datetime="$date$T$datetime$"$endif$>$date$</time> par <a class="p-author author" href="{{ BASE_URL }}#hs" rel="author"><i>{{ SITE_AUTHOR }}</i></a>. $if(modified)$Modifié le <time class="dt-updated">$modified$</time>.$endif$ </p> </address> </footer> diff --git a/templates/mustache/note.mustache b/templates/mustache/note.mustache @@ -29,9 +29,9 @@ <footer> <a class="note__link u-url u-uid u-syndication bookmark" href="#">#</a> - Publié le <time class="dt-published dt-updated" $if(datetime)$datetime="$date$T$datetime$"$endif$>$date$</time> + Publié le <time class="dt-published" $if(datetime)$datetime="$date$T$datetime$"$endif$>$date$</time> par <a class="p-author author" href="{{ SITE_URL }}#hs" rel="author"><i>{{ SITE_AUTHOR }}</i></a>. - <!-- <br/><a href="{{ SITE_URL }}/note">Retour à la liste des notes</a>. --> + $if(modified)$Modifié le <time class="dt-updated">$modified$</time>.$endif$ </footer> </div> </article>