diff options
Diffstat (limited to 'components/post-preview.sh')
-rwxr-xr-x | components/post-preview.sh | 26 |
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/> > $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 + |