From e9c35a9eff9e0881df7d6a6e8d17b70ac37ad0fe Mon Sep 17 00:00:00 2001 From: Jefferson Julio Date: Sun, 30 May 2021 20:06:28 -0300 Subject: Better modularization --- .gitignore | 2 + components/post-preview.sh | 26 ++++ config.sh | 8 + footer.sh | 17 +++ header.sh | 100 ++----------- index.sh | 39 +++-- nav.sh | 11 +- pages/article.sh | 21 +-- pages/contato.sh | 23 +++ pages/home.sh | 29 ++-- static/header.js | 137 +++++++++++++++++ static/styles.css | 359 +++++++++++++++++++++++++++++++++++++++++++++ styles.css | 279 ----------------------------------- utils/parse-article.sh | 18 +++ 14 files changed, 655 insertions(+), 414 deletions(-) create mode 100755 components/post-preview.sh create mode 100755 config.sh mode change 100644 => 100755 pages/contato.sh create mode 100644 static/header.js create mode 100644 static/styles.css delete mode 100644 styles.css create mode 100755 utils/parse-article.sh diff --git a/.gitignore b/.gitignore index eb2c80d..1661d60 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /pages/articles/* +/artigos/* +/articles/* diff --git a/components/post-preview.sh b/components/post-preview.sh new file mode 100755 index 0000000..dbbf663 --- /dev/null +++ b/components/post-preview.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +source $SCRIPT_DIR/utils/parse-article.sh + +cat < +
+
$ stat -c "%w" \\
> $ARTICLE_FILE
+ $ARTICLE_BYTES
+ + +
    + $( + for i in "${ARTICLE_TAGS[@]}"; do + echo "
  • $i
  • " + done + ) +
+
+ +

$(strip-html-tags "$ARTICLE_CONTENT" | head -c 120)...

+ + Ler artigo completo + +POST + diff --git a/config.sh b/config.sh new file mode 100755 index 0000000..4cfed05 --- /dev/null +++ b/config.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# All relatives paths must end with slash and must not be start by dot and/or slash +# Examplo +# VAR_PATH=dir/subdir/ + +# Folder where posts are stored, must be relative and suffed by a slash +ARTICLES_PATH=artigos/ diff --git a/footer.sh b/footer.sh index a7125bb..e7790cd 100755 --- a/footer.sh +++ b/footer.sh @@ -5,6 +5,19 @@ cat <