$(breadcrumbs $p)
EOF
done
cat << EOF >> ./docs/index.html
$(intro)
$(recent_link "Posts")
EOF
# posts
echo -ne "
Posts
" >> ./docs/posts/index.html
echo
echo "[+] POSTS"
for f in $posts; do
file="./posts/"$f
id="${file##*/}" # ill name my posts just fine
# generate posts
stats=$(wc "$file")
words="$(echo $stats | awk '{print $2}')"
lines="$(echo $stats | awk '{print $1}')"
r_time="$(read_time $words)"
height="$(height $lines)"
post_title=$(title_wrapper "$id")
echo "[~] $post_title"
post_date=$(date -r "$file" "+%d/%m — %Y")
post_link=$(link_wrapper "${id%.*}" "$post_title" "$post_date" "$r_time" "$height")
echo -ne "$post_link" >> ./docs/posts/index.html
if [[ $INDEX_BLOG_COUNT -lt $INDEX_BLOG_LIMIT ]]; then
echo -ne "$post_link" >> ./docs/index.html
fi
((INDEX_BLOG_COUNT+=1))
id="${id%.*}"
mkdir -p "docs/posts/$id"
esh \
-o "docs/posts/$id/index.html" \
post.esh \
file="$file" \
date="$post_date" \
title="$post_title" \
read_time="$r_time" \
height="$height" \
intro="$(intro)"
done
echo "$(more_links posts)" >> ./docs/index.html
echo "$(recent_link Art)" >> ./docs/index.html
# art
echo
echo "[+] ART"
esh \
-o "docs/art/index.html" \
art.esh
for f in $art; do
if [[ $INDEX_ART_COUNT -lt $INDEX_ART_LIMIT ]]; then
file="./art/"$f
id="${file##*/}"
art_title=$(title_wrapper "$id")
art_date=$(date -r "$file" "+%d/%m — %Y")
art_post=$(art_block "$f" "$art_title" "$art_date")
echo "[~] $art_title"
echo -ne "$art_post" >> ./docs/index.html
((INDEX_ART_COUNT+=1))
fi
done
echo "$(more_links art)" >> ./docs/index.html
# generate rss feeds
echo
echo "[+] Generating RSS feeds ..."
esh \
-o "./docs/index.xml" \
"rss.esh"
cat << EOF | tee -a ./docs/posts/index.html ./docs/index.html > /dev/null
EOF