diff --git a/dat/home b/dat/home
index c030ef9..34958e4 100644
--- a/dat/home
+++ b/dat/home
@@ -8,76 +8,6 @@ try to dump most of the things I create here, and leave it up to you whatever
you decide to do with it.
-=head2 Changes
-
-=over
-
-=item C<2012-02-15 > Added a new article on my new L
[yh-changes]
+É
diff --git a/img/feed_icon.png b/img/feed_icon.png
new file mode 100644
index 0000000..f2c843e
Binary files /dev/null and b/img/feed_icon.png differ
diff --git a/index.cgi b/index.cgi
index 6243ced..4740f11 100755
--- a/index.cgi
+++ b/index.cgi
@@ -3,13 +3,53 @@
use strict;
use warnings;
use utf8;
-use TUWF ':html';
+use TUWF ':html', ':xml';
+use POSIX 'strftime';
use Cwd 'abs_path';
our $ROOT;
BEGIN { ($ROOT = abs_path $0) =~ s{index\.cgi$}{}; }
+my @changes = (
+ [ '2012-02-15', '/doc/commvis', 'Added an article on my new communication system.' ],
+ [ '2012-02-13', '/ncdc', 'ncdc 1.8 released.' ],
+ [ '2012-01-19', '/tuwf', 'TUWF 0.2 released.' ],
+ [ '2012-01-17', undef, 'Complete site redesign.' ],
+ [ '2011-12-30', '/ncdc/', 'ncdc 1.7 released!' ],
+ [ '2011-12-07', '/ncdc/', 'ncdc 1.6 released!' ],
+ [ '2011-11-26', '/doc', 'Added article section and the article on SQLite.' ],
+ [ '2011-11-03', '/ncdu', 'ncdu 1.8 released!' ],
+ [ '2011-11-03', '/ncdc', 'ncdc 1.5 released!' ],
+ [ '2011-10-26', '/ncdc', 'ncdc 1.4 released!' ],
+ [ '2011-10-19', undef, 'PGP-signed all releases of ncdu, ncdc and TUWF.' ],
+ [ '2011-10-14', '/ncdc', 'ncdc 1.3 released!' ],
+ [ '2011-09-25', '/ncdc', 'ncdc 1.1 released - follwed by a 1.2 quickfix.' ],
+ [ '2011-09-16', '/ncdc', 'ncdc 1.0 released!' ],
+ [ '2011-09-15', '/ncdc/scr', 'Added some screenshots for ncdu.' ],
+ [ '2011-09-03', '/ncdc', 'ncdc 0.9 released!' ],
+ [ '2011-08-26', '/ncdc', 'ncdc 0.8 released!' ],
+ [ '2011-08-17', '/ncdc', 'ncdc 0.7 released!' ],
+ [ '2011-08-08', '/ncdc', 'ncdc 0.6 released & user guide updated' ],
+ [ '2011-08-02', '/ncdc', 'ncdc 0.5 released!' ],
+ [ '2011-07-23', '/ncdc', 'ncdc 0.4 released!' ],
+ [ '2011-07-15', '/ncdc', 'ncdc 0.3 released!' ],
+ [ '2011-06-27', '/ncdc', 'ncdc 0.2 released!' ],
+ [ '2011-06-20', '/ncdc', 'ncdc 0.1 released! And wrote a user guide for it.' ],
+ [ '2011-06-11', '/dump/nccolour', 'Added NCurses colour experiment' ],
+ [ '2011-06-03', '/ncdc', 'Added my latest project: ncdc' ],
+ [ '2011-02-07', '/tuwf', 'TUWF 0.1 released and now also available on CPAN' ],
+ [ '2011-01-27', '/tuwf', 'Documented and uploaded one of my older projects: TUWF' ],
+ [ '2011-01-09', '/dump', 'Added my json.mll OCaml library to code dump' ],
+ [ '2010-08-13', '/ncdu', 'ncdu 1.7 released!' ],
+ [ '2009-12-22', '/dump', 'Added vinfo.c script to code dump' ],
+ [ '2009-10-23', '/ncdu', 'ncdu 1.6 released!' ],
+ [ '2009-09-21', undef, 'Tiny CSS fix to make this site look good in certain configurations.' ],
+ [ '2009-05-02', '/ncdu', 'ncdu 1.5 released!' ],
+ [ '2009-04-30', undef, 'Site redesign and reorganisation.' ],
+);
+
+
TUWF::register(
qr{} => sub { podpage(shift, 'home', '', '', "Yorhel's Projects") },
qr{ncdu} => sub { podpage(shift, 'ncdu', 'ncdu', '', 'NCurses Disk Usage') },
@@ -32,6 +72,7 @@ TUWF::register(
qr{dump/awshrink} => sub { podpage(shift, 'dump-awshrink', 'dump', 'awshrink', 'AWStats Data File Shrinker') },
qr{dump/grenamr} => sub { podpage(shift, 'dump-grenamr', 'dump', 'grenamr', 'GTK+ Mass File Renamer') },
qr{dump/nccolour} => sub { podpage(shift, 'dump-nccolour', 'dump', 'nccolour', 'Colours in NCurses') },
+ qr{feed\.atom} => \&atom,
);
TUWF::set(
@@ -93,6 +134,37 @@ sub tuwfmanual {
}
+sub atom {
+ my $s = shift;
+ my $t = (stat("$ROOT/index.cgi"))[9];
+ $s->resHeader('Last-Modified' => strftime '%a, %d %b %Y %H:%M:%S GMT', gmtime $t);
+ $s->resHeader('Content-Type' => 'application/atom+xml');
+ xml;
+ tag feed => xmlns => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en', 'xml:base' => 'http://dev.yorhel.nl/';
+ tag title => "Yorhel's Projects";
+ tag updated => strftime('%Y-%m-%dT%H:%M:%SZ', gmtime $t);
+ tag id => "http://dev.yorhel.nl/feed.atom";
+ tag link => rel => 'self', type => 'application/atom+xml', href => "http://dev.yorhel.nl/feed.atom", undef;
+ tag link => rel => 'alternate', type => 'text/html', href => 'http://dev.yorhel.nl/', undef;
+
+ for(@changes) {
+ tag 'entry';
+ tag id => 'http://dev.yorhel.nl'.($_->[1]||'/').'#'.$_->[0];
+ tag title => $_->[2];
+ tag updated => $_->[0].'T12:00:00Z';
+ tag published => $_->[0].'T12:00:00Z';
+ tag 'author';
+ tag name => 'Yoran Heling';
+ tag uri => 'http://dev.yorhel.nl/';
+ tag email => 'projects@yorhel.nl';
+ end;
+ tag link => rel => 'alternate', type => 'text/html', href => 'http://dev.yorhel.nl'.($_->[1]||'/'), undef;
+ end 'entry';
+ }
+ end 'feed';
+}
+
+
sub notfound {
my $s = shift;
my $u = lc $s->reqPath;
@@ -125,6 +197,7 @@ use TUWF ':html';
# [dllink $file $title]
# [img $class $file $alt]
# [html]..É
+# [yh-changes]
sub htmlPOD {
my($s, $file, $toc) = @_;
require Pod::Simple::HTML;
@@ -161,6 +234,7 @@ sub htmlPOD {
$html =~ s/\[dllink ([^ ]+)(?: ([^>]+))?\]/$s->genDLLink($1, $2)/eg;
$html =~ s/\[img ([^ ]+) ([^ ]+) ([^\]]*)\]//g;
$html =~ s{\[html\](.*)É}{(my $h = $1) =~ s/\>/>/g; $h =~ s/\</genChanges()/e;
lit $html;
}
@@ -174,6 +248,18 @@ sub genDLLink {
}
+# Generate the changelog HTML for this website
+sub genChanges {
+ return join "\n", map {
+ "
$_->[0] "
+ .($_->[1]?qq{}:'')
+ .TUWF::XML::html_escape($_->[2])
+ .($_->[1]?'':'')
+ .'
';
+ } @changes;
+}
+
+
sub htmlHeader {
my $s = shift;
my %o = (page => '', sec => '', sec2 => '', @_ );
@@ -182,6 +268,7 @@ sub htmlHeader {
style type => 'text/css';
$s->printCSS;
end;
+ Link rel => 'alternate', type => 'application/atom+xml', href => '/feed.atom', title => 'Site updates';
title $o{title};
end;
body;
@@ -197,12 +284,12 @@ sub htmlHeader {
txt ' - '; a href => 'http://pgp.mit.edu:11371/pks/lookup?search=0x8c2739fa', 'pgp';
br;br;
lit q|
-