updated ascii art

This commit is contained in:
Alex Gentilucci 2020-09-02 20:16:07 -06:00
parent 280de42898
commit ddde25aa3f
Signed by: nytpu
GPG Key ID: 144ADD49F173F5CE
1 changed files with 34 additions and 12 deletions

View File

@ -28,7 +28,7 @@ make_globals() {
feed_base_url="https://nytpu.com/blog/" # base url that the feed is hosted at
index="index.gmi" # main page, not recommended to change
# don't change these
date_format_full="%a, %d %b %Y %H:%M:%S %z"
date_format_timestamp="%Y%m%d%H%M.%S"
@ -48,27 +48,27 @@ make_rss() {
{
pubdate=$(LC_ALL=C date +"$date_format_full")
echo '<?xml version="1.0" encoding="UTF-8" ?>'
echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">'
echo '<?xml version="1.0" encoding="UTF-8" ?>'
echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">'
echo "<channel><title>$global_title</title><link>$global_url$index</link>"
echo "<description>$global_description</description><language>en</language>"
echo "<lastBuildDate>$pubdate</lastBuildDate>"
echo "<pubDate>$pubdate</pubDate>"
echo "<atom:link href=\"$feed_base_url/$blog_feed\" rel=\"self\" type=\"application/rss+xml\">"
n=0
while IFS='' read -r i; do
((n >= number_of_feed_articles)) && break
echo "<item><title>"
echo "<item><title>"
get_post_title "$i"
echo "</title><description></description><link>$global_url${i#'./'}</link>"
echo "<guid>$global_url${i#'./'}</guid>"
echo "<dc:creator>$global_author</dc:creator>"
echo "</title><description></description><link>$global_url${i#'./'}</link>"
echo "<guid>$global_url${i#'./'}</guid>"
echo "<dc:creator>$global_author</dc:creator>"
echo "<pubDate>$(LC_ALL=C date -r "$i" +"$date_format_full")</pubDate></item>"
n=$(( n + 1 ))
done < <(ls -r ./[[:digit:]]*.gmi)
echo '</channel></rss>'
} 3>&1 >"$rssfile"
@ -80,9 +80,20 @@ make_rss() {
build_entries() {
echo "Building entries"
{
printf "# yatg (yet another tech gemlog)"
printf "## by nytpu"
cat << 'EOF'
```yatg by nytpu
,───────────────.
(_\ _________ \ __
│ /__|___|__\ │ __ ______ _/ /_____ _
`. \ / ,' │ / / / / __ `/ __/ __ `/
`.\ /,' │ / /_/ / /_/ / /_/ /_/ /
`.'\__, /\__,_/\__/\__, /
│ YET ANOTHER │ /____/ /____/
_│ TECH GEMLOG │ by nytpu
(_/_______________/
```
EOF
while IFS='' read -r i; do
post=$(basename $i)
title=$(get_post_title "$i")
@ -100,7 +111,18 @@ build_entries() {
} 3>&1 >"$index"
}
toot() {
filename=$(ls -r ./[[:digit:]]*.gmi | head -n 1 | xargs basename)
title=$(get_post_title "$filename")
read -r -p "do you want to toot the newest post? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]
then
printf "new blog post: ${title}\n\ngemini://nytpu.com/gemlog/${filename}" | toot post
fi
}
make_globals
make_rss
build_entries
toot