summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-02-15 05:48:40 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-02-15 05:48:40 +0000
commitf850acc6ad8a780a6b913df1099b8563647de03d (patch)
tree252f89382ab86f63a55fc4f8c181f5e609dc1076
parentcf2aabd6c87bd1dd3927016ed181180b765156fd (diff)
* Patch from Ethan to allow using meta tags to set creation dates of pages.
-rw-r--r--IkiWiki/Plugin/meta.pm7
-rw-r--r--debian/changelog3
-rw-r--r--doc/patchqueue/meta_param_to_set_ctime.mdwn29
-rw-r--r--doc/plugins/meta.mdwn5
-rw-r--r--po/ikiwiki.pot2
5 files changed, 15 insertions, 31 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 2e5fd7e76..5867329af 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -61,6 +61,13 @@ sub preprocess (@) { #{{{
$permalink{$page}=$value;
$meta{$page}.="<link rel=\"bookmark\" href=\"".encode_entities($value)."\" />\n";
}
+ elsif ($key eq 'date') {
+ eval q{use Date::Parse};
+ if (! $@) {
+ my $time = str2time($value);
+ $IkiWiki::pagectime{$page}=$time if defined $time;
+ }
+ }
else {
$meta{$page}.="<meta name=\"".encode_entities($key).
"\" content=\"".encode_entities($value)."\" />\n";
diff --git a/debian/changelog b/debian/changelog
index aaffd76ac..9a58ab437 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,8 +22,9 @@ ikiwiki (1.43) UNRELEASED; urgency=low
the user will be given an opportunity to retry.
Inspired by the many ways Moin Moin destroys itself when out of disk. :-)
* Fix syslogging of errors.
+ * Patch from Ethan to allow using meta tags to set creation dates of pages.
- -- Joey Hess <joeyh@debian.org> Wed, 14 Feb 2007 19:22:24 -0500
+ -- Joey Hess <joeyh@debian.org> Thu, 15 Feb 2007 00:44:29 -0500
ikiwiki (1.42) unstable; urgency=low
diff --git a/doc/patchqueue/meta_param_to_set_ctime.mdwn b/doc/patchqueue/meta_param_to_set_ctime.mdwn
deleted file mode 100644
index 5fc498862..000000000
--- a/doc/patchqueue/meta_param_to_set_ctime.mdwn
+++ /dev/null
@@ -1,29 +0,0 @@
-It would be nice to backdate some posts, so they can be sorted easier "by
-hand" when the ctime of the actual file is not what you want.
-
-The patch is [here](http://ikidev.betacantrips.com/patches/meta-date.patch).
-
-You can see it in use [here](http://ikidev.betacantrips.com/metadate/).
-
- diff -urX ignorepats ikiclean/IkiWiki/Plugin/meta.pm ikidev/IkiWiki/Plugin/meta.pm
- --- ikiclean/IkiWiki/Plugin/meta.pm 2007-02-11 21:40:32.002000000 -0800
- +++ ikidev/IkiWiki/Plugin/meta.pm 2007-02-12 07:44:11.182418000 -0800
- @@ -5,6 +5,7 @@
- use warnings;
- use strict;
- use IkiWiki;
- +use Date::Parse;
-
- my %meta;
- my %title;
- @@ -61,6 +62,10 @@
- $permalink{$page}=$value;
- $meta{$page}.="<link rel=\"bookmark\" href=\"".encode_entities($value)."\" />\n";
- }
- + elsif ($key eq 'date') {
- + my $time = str2time($value);
- + $IkiWiki::pagectime{$page}=$time;
- + }
- else {
- $meta{$page}.="<meta name=\"".encode_entities($key).
- "\" content=\"".encode_entities($value)."\" />\n";
diff --git a/doc/plugins/meta.mdwn b/doc/plugins/meta.mdwn
index 1cf801028..5c3098e56 100644
--- a/doc/plugins/meta.mdwn
+++ b/doc/plugins/meta.mdwn
@@ -48,6 +48,11 @@ You can use any field names you like, but here are some predefined ones:
Specifies a permanent link to the page, if different than the page
generated by ikiwiki.
+* date
+
+ Specifies the creation date of the page. The date can be entered in
+ nearly any format, since it's parsed by [[cpan TimeDate]].
+
If the field is not treated specially (as the link and title fields are),
the metadata will be written to the generated html page as a &lt;meta&gt;
header.
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index 941923d5c..972319eb8 100644
--- a/po/ikiwiki.pot
+++ b/po/ikiwiki.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-02-15 00:37-0500\n"
+"POT-Creation-Date: 2007-02-15 00:47-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"