fusch.online

git / lists / casts

git.fusch.online/planner

Generate static pages from a list of links
git clone git://git.fusch.online/planner
Log / Files / Readme / Issues

commit 0b517a12ea33ecaa157e7a20275b65f88cb84ccb
parent 1bd20953ef56ad6dc42b39d56230e06900397599
Author: hbkk <tschugg@posteo.de>
Date:   Sun, 31 Mar 2019 22:45:06 +0200

fix footer, pubdate for feed (items)

Diffstat:
Mlinks.sh | 58++++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 44 insertions(+), 14 deletions(-)

diff --git a/links.sh b/links.sh @@ -2,7 +2,8 @@ tmp=$(mktemp) offline=false -pubdate=$(date +"%a, %d %b %Y %H:%M:%S %z") +dateformat="+%a, %d %b %Y %H:%M:%S %z" +builddate=$(date "$dateformat") # main @@ -29,7 +30,6 @@ cat <<EOF > ./site/index.html margin-bottom: 4em; font-family: Tahoma, Verdana, Arial, sans-serif; font-size: 7pt; - color: black; } h2 { @@ -54,6 +54,17 @@ cat <<EOF > ./site/index.html text-align: center; } + .footer { + position: fixed; + left: 0; + bottom: 0; + width: 100%; + background-color: white; + padding: 0.4em; + text-align: center; + color: black; + } + a { text-decoration: none; } @@ -102,12 +113,18 @@ EOF cat << EOF > ./site/rss <?xml version="1.0" encoding="UTF-8" ?> -<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> -<channel><title>links</title><link>file:///home/hbkk/tmp/site/index.html</link> -<description>planner auf der wippe</description><language>en</language> -<lastBuildDate>$pubdate</lastBuildDate> -<pubDate>$pubdate</pubDate> -<atom:link href=\"file:///home/hbkk/tmp/site/rss\" rel=\"self\" type=\"application/rss+xml\" /> +<rss version="2.0" + xmlns:atom="http://www.w3.org/2005/Atom" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + +<channel> + <title>planner</title> + <link>file:///home/hbkk/tmp/site/index.html</link> + <description>planner auf der wippe</description> + <language>en</language> + <lastBuildDate>$builddate</lastBuildDate> + <pubDate>$builddate</pubDate> + <atom:link href="file:///home/hbkk/tmp/site/rss" rel="self" type="application/rss+xml" /> EOF while read -r line; do @@ -167,21 +184,34 @@ EOF printf " </div>\n" >> ./site/index.html + pubdate=$(date --date="$date" "$dateformat") + cat << EOF >> ./site/rss -<item><title>$title</title><description><![CDATA[$link]]></description> -<link>$link</link> -<guid>$link</guid> -<dc:creator>tutti</dc:creator> -<pubDate>$pubdate</pubDate></item> + <item> + <title>$title</title> + <description>![CDATA[$link]]</description> + <link>$link</link> + <guid>$link</guid> + <dc:creator>tutti</dc:creator> + <pubDate>$pubdate</pubDate> + </item> EOF done < "${1:-./links.txt}" cat << EOF >> ./site/index.html + <div class="footer"> + <a class="read new" href="file:///home/hbkk/tmp/site/rss">rss</a> + <a class="read new" href="https://tutti.town">tutti.town</a> + <a class="read new" href="https://kuku.tutti.town">kuku</a> + </div> </body> </html> EOF -echo '</channel></rss>' >> ./site/rss +cat << EOF >> ./site/rss +</channel> +</rss> +EOF mv "$tmp" ./db.csv