aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <http://smcv.pseudorandom.co.uk/>2008-07-11 23:57:47 +0100
committerSimon McVittie <http://smcv.pseudorandom.co.uk/>2008-07-11 23:57:47 +0100
commit9c6444bf681ec48e3832282906d1d2cfad586cb5 (patch)
tree251c16ea85415ad9a2ddda7a9f738895f8831769 /IkiWiki
parentfc917fa3831bbea5305e50a8fde4457ff480ad64 (diff)
downloadikiwiki-9c6444bf681ec48e3832282906d1d2cfad586cb5.tar
ikiwiki-9c6444bf681ec48e3832282906d1d2cfad586cb5.tar.gz
meta plugin: if uuid looks like it is in fact a UUID, prepend "urn:uuid" (otherwise leave it alone, so we can assign non-UUID <id>s to Atom items to avoid planet-flooding)
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/meta.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 81355ef6d..02c99e9f6 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -85,7 +85,13 @@ sub preprocess (@) { #{{{
# fallthrough
}
elsif ($key eq 'uuid') {
- $pagestate{$page}{meta}{uuid}=HTML::Entities::encode_numeric($value);
+ my $abs = $value;
+
+ if ($abs =~ m/^[[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12}$/) {
+ $abs = lc "urn:uuid:$abs";
+ }
+
+ $pagestate{$page}{meta}{uuid}=HTML::Entities::encode_numeric($abs);
# fallthrough
}
elsif ($key eq 'license') {