werc-1.5.0-tweaks

Tweaks for the werc website builder created by the mad architect Uriel
Log | Files | Refs | README

rss20.tpl (1982B)


      1 <?xml version="1.0" encoding="UTF-8"?>
      2 
      3 %{
      4 fn statpost {
      5     f = $1
      6     post_uri = `{echo $f | sed 's,^'$sitedir',,'}
      7     title=`{read $f/index.md}
      8     relative_uri=`{cleanname `{echo $f | sed -e 's!^'$sitedir'!!'}}
      9     post_uri=$base_url^$relative_uri^'/'
     10     by=`{ls -m $f | sed 's/^\[//g; s/].*$//g' >[2]/dev/null}
     11     extracted_on=`{echo $relative_uri | sed 's|/blog/||g' | head -c 10 }
     12     published_on=`{ /bin/date -R -D '%Y/%m/%d' -d $extracted_on }
     13     ifs=() {summary=`{ cat $f/index.md |strip_title_from_md_file | head -n 9 | ifs=$difs {$formatter | escape_html} }}
     14 }
     15 
     16 %}
     17 
     18 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
     19     <channel>
     20         <atom:link href="%($base_url^$req_path%)" rel="self" type="application/rss+xml" />
     21         <title><![CDATA[%($siteTitle%)]]></title>
     22         <link>%($base_url^$req_path%)</link>
     23         <description><![CDATA[%($blogDesc%)]]></description>
     24         <language>en-us</language>
     25         <generator><![CDATA[Tom Duff's rc, and Kris Maglione's clever hackery]]></generator>
     26 %{
     27         # <webMaster>uriel99+rss@gmail.com (Uriel)</webMaster>
     28 	# rfc2822 last time channel content changed.
     29 	lbd=`{ndate -m `{date `{mtime `{ls $blagh_root$blagh_dirs/[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/[0-9] | tail -1} | awk '{print $1}'}}}
     30 	echo '<lastBuildDate>'$"lbd'</lastBuildDate>'
     31 	# rfc2822 publication date for content in the channel.
     32 	pubdate=`{ndate -m}
     33         for(f in `{get_post_list $blagh_root$blagh_dirs}){
     34             statpost $f
     35 %}
     36         <item>
     37             <title><![CDATA[%($title%)]]></title>
     38         %{
     39 	   # <author><![CDATA[%($by%)@noreply.cat-v.org (%($by%))]]></author>
     40 	   echo '<author><![CDATA[nuno.sempere@protonmail.com (Nuño Sempere)]]></author>'
     41 	%}
     42             <link>%($post_uri%)</link>
     43             <guid isPermaLink="true">%($post_uri%)</guid>
     44             <pubDate>%( $published_on %)</pubDate>
     45             <description> %($summary%) </description>
     46         </item>
     47 %        }
     48     </channel>
     49 </rss>