initial import of changes from 9front bikeshedding; bundle rc-httpd

This commit is contained in:
Stanley Lieber 2016-02-04 15:05:05 -05:00
parent 6d3bcc867c
commit a99fa8b44f
46 changed files with 1061 additions and 572 deletions

View file

@ -6,13 +6,13 @@ fn statpost {
post_uri = `{echo $f | sed 's,^'$sitedir',,'}
#title=`{basename $f | sed 's/^[0-9\-]*_(.*)\.md$/\1/; s/_/ /g' }
title=`{read $f/index.md}
date=`{/bin/date -Rd `{echo $f|sed 's,.*/([0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9])/.*,\1,'}}
title=`{read $f/index.md}
date=`{date `{mtime $f | awk '{print $1}'}} # rss 2.0 spec says pubDate should conform to rfc822
# TODO: use mtime(1) and ls(1) instead of lunix's stat(1)
stat=`{stat -c '%Y %U' $f}
#stat=`{stat -c '%Y %U' $f}
#mdate=`{/bin/date -Rd $stat(1)} # Not used because it is unreliable
post_uri=$base_url^`{cleanname `{echo $f | sed -e 's!^'$sitedir'!!'}}^'/'
by=$stat(2)
by=`{ls -m $f | sed 's/^\[//g; s/].*$//g' >[2]/dev/null}
ifs=() {summary=`{ cat $f/index.md |strip_title_from_md_file| ifs=$difs {$formatter | escape_html} }}
}
@ -21,11 +21,11 @@ fn statpost {
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="%($base_url^$req_path%)" rel="self" type="application/rss+xml" />
<title>%($siteTitle%)</title>
<title><![CDATA[%($siteTitle%)]]></title>
<link>%($base_url^$req_path%)</link>
<description>%($blogDesc%)</description>
<description><![CDATA[%($blogDesc%)]]></description>
<language>en-us</language>
<generator>Tom Duff's rc, and Kris Maglione's clever hackery</generator>
<generator><![CDATA[Tom Duff's rc, and Kris Maglione's clever hackery]]></generator>
%{
# <webMaster>uriel99+rss@gmail.com (Uriel)</webMaster>
for(f in `{get_post_list $blagh_root$blagh_dirs}) {
@ -39,12 +39,12 @@ fn statpost {
#}
%}
<item>
<title>%($title%)</title>
<author>%($by%)@noreply.cat-v.org (%($by%))</author>
<title><![CDATA[%($title%)]]></title>
<author><![CDATA[%($by%)@noreply.cat-v.org (%($by%))]]></author>
<link>%($post_uri%)</link>
<guid isPermaLink="true">%($post_uri%)</guid>
<pubDate>%($date%)</pubDate>
<description>%($summary%)</description>
<description><![CDATA[%($summary%)]]></description>
</item>
% }