#!/usr/bin/perl # Announcements are read from dat/index.md; Each announcement must have the following format: # `$date` - $title $meta # : $body # # The $meta and $body are optional. $meta must be in the form: # or # # $fields can be: # tags: comma-separated list of tags, these are used to determine whether an # announcement belongs to a particular feed. # link: Path that the announcement should link to, absent = '/' use TUWF::XML ':xml'; use POSIX 'strftime'; use IPC::Open2; $sub = (shift =~ m{pub/(?:([^/]+)/)?feed.atom} ? $1 : ''); $/=undef; my $body = <>; my @annuncements; while($body =~ /`([0-9]{4}-[0-9]{2}-[0-9]{2})` - ([^\n]+)\n(: .+\n(?:\n| .+\n)*)?/mg) { my($date, $title, $data) = ($1,$2,$3); $data =~ s/^:/ /; $data =~ s/^ //mg; $data =~ s/\s+$//; $meta = $title =~ s/ *