Skip to content

Instantly share code, notes, and snippets.

@fujiwara
Created December 2, 2009 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujiwara/247010 to your computer and use it in GitHub Desktop.
Save fujiwara/247010 to your computer and use it in GitHub Desktop.
diff --git a/data/base.xml b/data/base.xml
index 333a0f9..f0dcb52 100644
--- a/data/base.xml
+++ b/data/base.xml
@@ -1,4 +1,5 @@
? use DateTime::Format::HTTP;
+? my $today = DateTime->now();
<?= encoded_string qq[<\?xml version="1.0" encoding="utf-8"?\>] ?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -10,6 +11,7 @@
<description><? block description => '' ?></description>
? my @entries = sort { $b->filename cmp $a->filename } @{ $page->entries || [] };
? for my $entry (splice @entries, 0, 15) {
+? next if $entry->datetime > $today;
<item>
<title><?= $entry->title ?></title>
<link><? block 'link' ?><?= substr $entry->path, 1 ?>/<?= $entry->filename ?>.html</link>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment