aboutsummaryrefslogtreecommitdiff
path: root/components/post-preview.sh
blob: 9e5bb978970fa3ab10b653da61fa21dd5c575e22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash

DO_NOT_PROCESS_HTML=true source $SCRIPT_DIR/utils/parse-article.sh

cat <<POST
<section class="post-preview">
  <div class="post-header-preview">
    <h5 class="post-title"><a href="$ARTICLE_URL">$ARTICLE_FILE</a></h5>
    <small>$ARTICLE_BYTES</small> <br/>
    <time>$ARTICLE_TIME</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_URL">Ler artigo completo</a>
</section>
POST