aboutsummaryrefslogtreecommitdiff
path: root/pages/article.sh
blob: 3cb5ab7edfc9365909e6d6dc7c056128240259c9 (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
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

source $SCRIPT_DIR/utils/parse-article.sh

if [ $? -gt 0 ]; then
  STATUS=404
  cat <<ERR
<p class="err-404">404: $ARTICLE_FILE: Arquivo ou diretório inexistente</p>
ERR
  exit 0
fi

cat <<ARTICLE
<article class="container">
  <section>
    <div class="post-header">
      <h4 class="post-title">$ARTICLE_FILE</h4>
      <small>$ARTICLE_BYTES</small> <br/>
      <time>$ARTICLE_TIME</time> <br/>

      <ul class="tags">
        $(
          for i in "${ARTICLE_TAGS[@]}"; do
            echo "<li class="tag">$i</li>"
          done
        )
      </ul>
    </div>

    <div class="post-content">
      <p>
        ${ARTICLE_CONTENT}
      </p>
    </div>
  </section>
</article>
ARTICLE