diff --git a/apps/blagh/app.rc b/apps/blagh/app.rc index 60c4678..52fd449 100644 --- a/apps/blagh/app.rc +++ b/apps/blagh/app.rc @@ -74,15 +74,14 @@ fn blagh_body { # An user can add this on their own using handlers_body_head anyway. #echo '
' - { # XXX Not sure why this fixes issues with blog setup, probably bug in fltr_cache! + # XXX Not sure why this fixes issues with blog setup, probably bug in fltr_cache! for(p in `{get_post_list $blagh_root^$blagh_dirs}) { l=`{echo -n $p|sed 's!'$sitedir^'/?(.*)([0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9])(/[^/]+/)!\2 /\1\2\3!'} sed '1s!.*^') ('^$l(1)^')!' < $p/index.md echo # Needed extra \n so markdown doesn't mess up the formatting, probably can be done in sed. - } + } | $formatter # XXX BUG! Markdown [references] break because multiple markdown documents are merged. Should format each blog post independently. # TODO: use fltr_cache directly, that can fix the previous bug plus provide a perf boost by caching title generation. - } | $formatter } fn get_post_list { diff --git a/apps/blagh/atom.tpl b/apps/blagh/atom.tpl index 4dc5c6f..1ce511d 100644 --- a/apps/blagh/atom.tpl +++ b/apps/blagh/atom.tpl @@ -5,18 +5,16 @@ fn statpost { f = $1 - updated = `{datet `{mtime $f | awk '{print $1}'}} + updated = `{date -t `{mtime $f | awk '{print $1}'}} # wtf doesn't this validate? post_uri=$base_url^`{cleanname `{echo $f | sed -e 's!^'$sitedir'!!'}}^'/' title=`{read $f/index.md} - # Not used: date=`{/bin/date -Rd `{basename $f |sed 's/(^[0-9\-]*).*/\1/; s/-[0-9]$//'}} - # TODO: use mtime(1) and ls(1) instead of lunix's stat(1) #stat=`{stat -c '%Y %U' $f} #mdate=`{/bin/date -Rd `{mtime $f|awk '{print $1}' }} # Not used because it is unreliable by=`{ls -m $f | sed 's/^\[//g; s/].*$//g' >[2]/dev/null} #ifs=() { summary=`{cat $f/index.md | crop_text 1024 ... | $formatter } } ifs=() { summary=`{cat $f/index.md | strip_title_from_md_file | ifs=$difs {$formatter} } } } -updated = `{datet} +updated = `{ndate -t} %}