From a2285097fe0b16a7d892e2035583ca2eb37c643f Mon Sep 17 00:00:00 2001 From: Simon Petit Date: Wed, 13 Nov 2024 23:23:13 +0100 Subject: [PATCH] updgrading publish function : to be tested --- bob | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bob b/bob index a2ecb2a..b8bdaaf 100755 --- a/bob +++ b/bob @@ -81,7 +81,9 @@ publish() { post=$(awk -f ${BOB_LIB}/markdown.awk ./drafts/$1.md) template="${BOB_LIB}/template/post.html" - awk -v content="$post" '{gsub(/{{article}}/, content); print}' "$template" > "./posts/$1.html" + escaped_post=$(echo "$post" | sed 's/&/\\&/g') + # awk -v content="$post" '{gsub(/{{article}}/, content); print}' "$template" > "./posts/$1.html" + awk -v content="$escaped_content" '{gsub(/\{\{article\}\}/, content); print}' "template" > "./posts/$1.html" mv ./drafts/$1.md ./drafts/published/$1.md update_index