diff options
Diffstat (limited to 'pages/home.sh')
-rwxr-xr-x | pages/home.sh | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/pages/home.sh b/pages/home.sh index ebb399d..c9a9966 100755 --- a/pages/home.sh +++ b/pages/home.sh @@ -1,25 +1,26 @@ #!/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> +welcome () { + cat <<WELCOME +<section class="conainer" id="welcome"> + <header> + <h1>Bem-vindo ao meu blog :3</h1> + <h4>Aqui mostro o meu trabalho e escrevo sobre programação.</h4> + </header> </section> -POST +WELCOME +} + +print-all-articles () { + # Find all articles and sort by date of creation + for i in $(find $ARTICLES_PATH -type f -name '*.txt' -printf "%T@ %p\n" | sort -rn | cut -b 23-); do + ARTICLE_FILE="${i/* /}" source $SCRIPT_DIR/components/post-preview.sh done } cat <<PAGE <article class="home-feed container"> + $(welcome) $(print-all-articles) </article> PAGE |