diff options
Diffstat (limited to 'pages/home.sh')
-rwxr-xr-x | pages/home.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pages/home.sh b/pages/home.sh new file mode 100755 index 0000000..ebb399d --- /dev/null +++ b/pages/home.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +print-all-articles () { + for i in $(find ./pages/articles -type f -name '*.txt'); do + ARTICLE_CONTENT=$(tail -n +3 $i) + cat <<POST +<section class="post-preview"> + <div class="post-header-preview"> + <h5 class="post-title">stat -c "%w %z" $i</h5> + <time>$(stat --format="Criado em: %w<br/>Última atualização: %z" $i)</time> + </div> + + <p>$(echo "$ARTICLE_CONTENT" | head -c 120)...</p> + + <a href="/artigo/$(basename $i)">Ler artigo completo</a> +</section> +POST + done +} + +cat <<PAGE +<article class="home-feed container"> + $(print-all-articles) +</article> +PAGE |