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 ed935d0bc548fccf0a97ca255277be260ec61623
parent b0e9b6cad30af8c545c2c0ca82079cfbd6485cd0
Author: hbkk <tschugg@posteo.de>
Date:   Thu,  4 Apr 2019 03:52:37 +0200

add support for header.html and footer.html

Diffstat:
Afooter.html | 4++++
Aheader.html | 11+++++++++++
Mplanner | 27+++++++++------------------
3 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/footer.html b/footer.html @@ -0,0 +1,4 @@ + <div class="footer"> + <a class="read new" href="./rss">rss</a> + <a class="read new" href="./tags.html">tags</a> + </div> diff --git a/header.html b/header.html @@ -0,0 +1,11 @@ + <div class="header"> + <a class="read new" href="https://git.example.om">git</a> + <a class="read new" href="https://planner.example.com">planner</a> + <a href="https://example.com"> + <h1>example.com</h1> + </a> + <a href="./"> + <h2>planner</h2> + </a> + {{{ tag }}} + </div> diff --git a/planner b/planner @@ -7,6 +7,7 @@ offline=false dateformat="+%a, %d %b %Y %H:%M:%S %z" builddate=$(date "$dateformat") baseurl=${BASEURL:-example.com} +sitetitle="planner" print_html_head() { @@ -15,30 +16,20 @@ print_html_head() { <html lang="en"> <head> <meta charset="utf-8"> - <title>planner/$1</title> + <title>$sitetitle/$1</title> <link rel="stylesheet" href="./style.css"> </head> <body> - <div class="header"> - <a class="read new" href="https://git.$baseurl">git</a> - <a class="read new" href="https://planner.$baseurl">planner</a> - <a href="https://$baseurl"> - <h1>$baseurl</h1> - </a> - <a href="./"> - <h2>planner</h2> - </a> - <p>$1<p> - </div> EOF + + sed -e "s/{{{ tag }}}/<p>$1<\/p>/g" \ + -e "s/{{{ head }}}/<a href=\".\/\"><h2>$sitetitle<\/h2><\/a>/g" ./header.html } print_html_tail() { + cat ./footer.html + cat << EOF - <div class="footer"> - <a class="read new" href="./rss">rss</a> - <a class="read new" href="./tags.html">tags</a> - </div> </body> </html> EOF @@ -68,9 +59,9 @@ print_rss_head() { xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> - <title>planner</title> + <title>$sitetitle</title> <link>$PLANNER_URL</link> - <description>planner auf der wippe</description> + <description>$sitetitle auf der wippe</description> <language>en</language> <lastBuildDate>$builddate</lastBuildDate> <pubDate>$builddate</pubDate>