aboutsummaryrefslogtreecommitdiff
path: root/utils/parse-article.sh
diff options
context:
space:
mode:
authorJefferson Julio <[email protected]>2021-05-30 22:53:32 -0300
committerJefferson Julio <[email protected]>2021-05-30 22:53:32 -0300
commit381bff129b70471e86e99a2d6b6a7e090f13287e (patch)
tree35d383b4ec622efd8fbbd49a72c44a5561a04f92 /utils/parse-article.sh
parente9c35a9eff9e0881df7d6a6e8d17b70ac37ad0fe (diff)
downloadblog.sh-381bff129b70471e86e99a2d6b6a7e090f13287e.tar.bz2
blog.sh-381bff129b70471e86e99a2d6b6a7e090f13287e.zip
Better article parsing, support for article code parsing (add line numbers to code blocks)
Diffstat (limited to 'utils/parse-article.sh')
-rwxr-xr-xutils/parse-article.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/parse-article.sh b/utils/parse-article.sh
index c3e540a..b64c0ff 100755
--- a/utils/parse-article.sh
+++ b/utils/parse-article.sh
@@ -1,6 +1,7 @@
#!/bin/bash
ARTICLE_TITLE=$(basename "$ARTICLE_FILE")
+ARTICLE_FILE_SANITIZED="$(sanitize-filename "$ARTICLE_FILE")"
# Pick all file content
ARTICLE_FILE_CONTENT=$(cat "$ARTICLE_FILE")
@@ -8,8 +9,7 @@ ARTICLE_FILE_CONTENT=$(cat "$ARTICLE_FILE")
# The first 3 lines of the file are metadata information
ARTICLE_METADATA=$(echo "$ARTICLE_FILE_CONTENT" | head -n 3)
-# Skip file metadata, first 3 lines
-ARTICLE_CONTENT=$(echo "$ARTICLE_FILE_CONTENT" | tail -n +3)
+source $SCRIPT_DIR/utils/parse-article-content.sh
# Tags are placed on the first line of the file, delimited by commas
IFS=',' read -ra ARTICLE_TAGS <<< "$(echo "$ARTICLE_METADATA" | head -n 1)"