pdssg

Pandoc static site generator
Log | Files | Refs | README | LICENSE

commit 85610155303e4dfd3e276cb57861bbf1cb5d027d
parent d19ca47febe1aceaf5925de67c42d4000e6a7264
Author: Byron Torres <torresjrjr@pm.me>
Date:   Sun,  5 Jul 2020 11:58:48 +0100

Add 'is_article' test to pandoc conversion loop

Diffstat:
Mpdssg | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/pdssg b/pdssg @@ -138,12 +138,18 @@ process_files() { bool_toc="$(_get_safe_slug toc "$block")" [ -n "$bool_toc" ] && flag_toc="--toc" - ### per file logic ### + ### feed gen directory test ### cache_file="$TMP_DIR/${md_file%.md}/meta.yaml" [ -f "$cache_file" ] && { flag_metadata_file="--metadata-file=$cache_file" } + ### article test ### + cache_file="$TMP_DIR/$(dirname $md_file)/meta.yaml" + [ -f "$cache_file" ] && { + flag_is_article="-M is_article:true" + } + ### create full HTML page ### pandoc \ -f markdown -t html \ @@ -159,10 +165,12 @@ process_files() { --webtex='https://latex.codecogs.com/svg.latex?' \ $flag_toc \ $flag_metadata_file \ + $flag_is_article \ ### prepare for next md file unset flag_toc unset flag_metadata_file + unset flag_is_article done }