Compare commits

...

2 Commits

Author SHA1 Message Date
nytpu 2fdd5e9328
fixed typo in atom feed 2020-09-09 23:22:19 -06:00
nytpu f927e701d6
updated footer of index to use heredoc too 2020-09-09 23:20:24 -06:00
1 changed files with 15 additions and 13 deletions

View File

@ -33,8 +33,8 @@ make_globals() {
index="index.gmi" # main page of gemlog, not recommended to change
# don't change these
gemlog_sh_link="https://tildegit.org/nytpu/gemlog.sh"
date_format_8601="+%Y-%m-%dT%H:%M:%S%:z"
gemlog_sh_link="https://tildegit.org/nytpu/gemlog.sh" # link to the utility, you should change this if you modified it substantially
date_format_8601="+%Y-%m-%dT%H:%M:%S%:z" # *formal* ISO-8601 format including time zone
}
get_post_title() {
@ -52,7 +52,6 @@ make_atom() {
cat << EOF
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>$global_title</title>
<subtitle>$global_description</subtitle>
<link rel='self' href='$feed_base_url$gemlog_feed'/>
@ -60,7 +59,7 @@ make_atom() {
<updated>$pubdate</updated>
<author>
<name>$global_author</name>
<email>$global_author_email</email
<email>$global_author_email</email>
<uri>$global_author_url</uri>
</author>
<id>$global_url</id>
@ -76,7 +75,7 @@ EOF
printf " <link rel='alternate' href='$global_url${i#'./'}'/>\n <updated>"
echo "$i" | perl -ne '/^(\d{4}-\d{2}-\d{2}).*/; print $1' | date "$date_format_8601" -f - | tr -d '\n'
# change or remove the <summary></summary> block if you want a different description or no description at all
printf "</updated>\n <summary>You need a gemini client to view this post. If you have one installed, here is the link to the post: $global_url${i#'./'}\"&gt;$global_url${i#'./'}</summary>\n </entry>\n"
printf "</updated>\n <summary>You need a gemini client to view this post. If you have one installed, here is the link to the post: $global_url${i#'./'}</summary>\n </entry>\n"
n=$(( n + 1 ))
done < <(ls -r [[:digit:]]*.gmi)
@ -114,14 +113,17 @@ EOF
done < <(ls -r [[:digit:]]*.gmi)
# footer of the page (below the list of posts)
printf "\r\n\r\n"
printf "=> / go home\r\n"
printf "\r\n"
printf "this gemlog has an atom feed at:\r\n"
printf "=> $feed_base_url$gemlog_feed [https] $feed_base_url$gemlog_feed\r\n"
printf "=> /gemlog/$gemlog_feed or here to access it through gemini\r\n"
printf "\r\n"
printf "=> /gemlog/old/ click here to view an archive of my old gemlog"
sed 's/$/\r/g' << EOF
=> / go home
=> /gemlog/old/ click here to view an archive of my old gemlog
=> $feed_base_url$gemlog_feed this gemlog has an atom feed at: $feed_base_url$gemlog_feed
=> gemini://nytpu.com/gemlog/$gemlog_feed or through gemini at: gemini://nytpu.com/gemlog/$gemlog_feed
=> https://tildegit.org/nytpu/gemlog.sh generated with gemlog.sh
EOF
} 3>&1 >"$index"
}