From 77600d79c56341150e09e7b603cd66e8488ac52b Mon Sep 17 00:00:00 2001
From: Yorhel
Date: Fri, 17 Feb 2012 15:59:02 +0100
Subject: [PATCH] Added EOF-footer, atom feed for site changes and fixed paypal
XHTML
---
dat/home | 76 ++-----------------------------
img/feed_icon.png | Bin 0 -> 556 bytes
index.cgi | 112 +++++++++++++++++++++++++++++++++++++++++-----
3 files changed, 104 insertions(+), 84 deletions(-)
create mode 100644 img/feed_icon.png
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.
-
-=item C<2012-02-13 > ncdc 1.8 released.
-
-=item C<2012-01-19 > TUWF 0.2 released.
-
-=item C<2012-01-17 > Complete site redesign.
-
-=item C<2011-12-30 > ncdc 1.7 released!
-
-=item C<2011-12-07 > ncdc 1.6 released!
-
-=item C<2011-11-26 > Added article section and the article on SQLite.
-
-=item C<2011-11-03 > ncdc 1.5 and ncdu 1.8 released!
-
-=item C<2011-10-26 > ncdc 1.4 released!
-
-=item C<2011-10-19 > PGP-signed all releases of ncdu, ncdc and TUWF.
-
-=item C<2011-10-14 > ncdc 1.3 released!
-
-=item C<2011-09-25 > ncdc 1.1 released - follwed by a 1.2 quickfix.
-
-=item C<2011-09-16 > ncdc 1.0 released!
-
-=item C<2011-09-15 > Added some screenshots for ncdu.
-
-=item C<2011-09-03 > ncdc 0.9 released!
-
-=item C<2011-08-26 > ncdc 0.8 released!
-
-=item C<2011-08-17 > ncdc 0.7 released!
-
-=item C<2011-08-08 > ncdc 0.6 released & user guide updated
-
-=item C<2011-08-02 > ncdc 0.5 released!
-
-=item C<2011-07-23 > ncdc 0.4 released!
-
-=item C<2011-07-15 > ncdc 0.3 released!
-
-=item C<2011-06-27 > ncdc 0.2 released!
-
-=item C<2011-06-20 > ncdc 0.1 released! And wrote a user guide for it.
-
-=item C<2011-06-11 > Added NCurses colour experiment at code dump => nc-colour
-
-=item C<2011-06-03 > Added my latest project: ncdc
-
-=item C<2011-02-07 > TUWF 0.1 released and now also available on CPAN
-
-=item C<2011-01-27 > Documented and uploaded one of my older projects: TUWF
-
-=item C<2011-01-09 > Added my json.mll OCaml library to code dump
-
-=item C<2010-08-13 > ncdu 1.7 released!
-
-=item C<2009-12-22 > Added vinfo.c script to code dump
-
-=item C<2009-10-23 > ncdu 1.6 released!
-
-=item C<2009-09-21 > Tiny CSS fix to make this site look good in certain configurations.
-
-=item C<2009-05-02 > ncdu 1.5 released!
-
-=item C<2009-04-30 > Site redesign and reorganisation.
-
-=back
+[html]
Changes 
+[yh-changes]
+É
diff --git a/img/feed_icon.png b/img/feed_icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..f2c843ec9c94524e0efbda3e5915d0bcef1bdab0
GIT binary patch
literal 556
zcmV+{0@MA8P)(7#KSQ5eAS@AI5|$6Zm6i@yE}>uMbG|hgf8)B9o$usux@kNZZ7vS&ErURErOg
zzCpspX>xOvs>sA5kt;(*L4(kkxJ7g7DUB;Lu(?E>y$R|G=kJp$M^$8UG*q47YD)R?
zI`Q2jq_0J|@R-yycIF?V`$q7mrbuNbCqu>UCP~@BR^Jj|UxU;mjNf7V{VUSe8jaJF
z#4=-%T|vE2n|wmJ{G60(>?}^B`$v%0Np?Oh;9EzaK0wZfnwY5*th0o5H>kEYDZefP
z;0BJ;TmJ!o_P4N%$=ba$%L51fSS-^28>WhR!HR2nH7mW0|+ec5-uuZ~+Do@+G1
ukyM#xJQfTjqaLJT1S6-ASGpVP6aN5 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|
- |;
+ |;
end;
end 'div';
div id => 'main';
@@ -212,7 +299,9 @@ sub htmlHeader {
sub htmlFooter {
end 'div'; # main
- div id => 'anotherhack', ' ';
+ div id => 'footer';
+ p 'end-of-file';
+ end;
end 'div'; # body
end 'body';
end 'html';
@@ -290,10 +379,11 @@ sub printCSS {
* { margin: 0; padding: 0; font: 15px 'Buenard',serif; color: #222 }
#body { text-align: left; width: 800px; margin: 0 auto; background: #fff; border-left: 1px solid #aaa; border-right: 1px solid #aaa; min-height: 100% }
#uglyhack { height: 30px }
- #anotherhack { clear: left }
#main, #left { float: left; border-top: 0px dashed #aaa, margin-top: 50px }
- #left { width: 130px; border-right: 1px dashed #aaa; padding: 20px 10px }
- #main { width: 609px; padding: 12px 20px }
+ #left { width: 130px; border-right: 1px dashed #aaa; padding: 20px 10px; margin-bottom: 30px }
+ #main { width: 609px; padding: 12px 20px 30px 20px }
+ #footer { clear: left; width: 150px; margin: 0 0 0 324px; border-top: 1px dashed #aaa; height: 20px; text-align: center }
+ #footer p { position: relative; top: -10px; padding: 0; background: #fff; display: inline; color: #aaa }
#left h1 { font-weight: bold; text-align: center; font-size: 15px }
#left li { margin: 20px 0 0 10px; list-style-type: none }
#left li a { text-decoration: none; display: block; width: 120px; border-bottom: 1px solid #fff }