aboutsummaryrefslogtreecommitdiff
path: root/components/post-preview.sh
diff options
context:
space:
mode:
authorJefferson Julio <[email protected]>2021-05-30 20:06:28 -0300
committerJefferson Julio <[email protected]>2021-05-30 20:06:28 -0300
commite9c35a9eff9e0881df7d6a6e8d17b70ac37ad0fe (patch)
tree2a6a9d105b68daea1094e5a2faaca0fb9b138ab3 /components/post-preview.sh
parent1d628ce8cee397ca9c2a8a27d5820c91812a27ca (diff)
downloadblog.sh-e9c35a9eff9e0881df7d6a6e8d17b70ac37ad0fe.tar.bz2
blog.sh-e9c35a9eff9e0881df7d6a6e8d17b70ac37ad0fe.zip
Better modularization
Diffstat (limited to 'components/post-preview.sh')
-rwxr-xr-xcomponents/post-preview.sh26
1 files changed, 26 insertions, 0 deletions
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 <<POST
+<section class="post-preview">
+ <div class="post-header-preview">
+ <h5 class="post-title">$ stat -c "%w" \\<br/> &gt;&ensp;$ARTICLE_FILE</h5>
+ <small>$ARTICLE_BYTES</small> <br/>
+ <time>$(stat --format="Criado em: %w" $ARTICLE_FILE)</time>
+
+ <ul class="tags">
+ $(
+ for i in "${ARTICLE_TAGS[@]}"; do
+ echo "<li class="tag">$i</li>"
+ done
+ )
+ </ul>
+ </div>
+
+ <p>$(strip-html-tags "$ARTICLE_CONTENT" | head -c 120)...</p>
+
+ <a href="/$ARTICLE_FILE">Ler artigo completo</a>
+</section>
+POST
+