summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-07-25 20:18:02 -0400
committerJoey Hess <joey@kitenet.net>2010-07-25 20:18:02 -0400
commitdd9d117894952efb23c8b444ae27672571d6548a (patch)
treef582830102f1195b9eda2a47cc85a518ada6b832
parent80903dff493738bc66fd14b7f7ec52174af7311c (diff)
meta: Allow syntax closer to html meta to be used.
The idea here is that <meta name="foo" description="bar"> can be written like [[!meta name="foo" description="bar">. Of course, [[!meta foo=bar]] is still supported; this new feature provides some DWIM when trying to directly convert a meta tag into a meta directive.
-rw-r--r--IkiWiki/Plugin/meta.pm14
-rw-r--r--debian/changelog1
2 files changed, 12 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 7d68a9b2d..d18585d3d 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -253,12 +253,20 @@ sub preprocess (@) {
' content="'.encode_entities($value).'" />';
}
elsif ($key eq 'description') {
- push @{$metaheaders{$page}}, '<meta name="'.encode_entities($key).
+ push @{$metaheaders{$page}}, '<meta name="'.
+ encode_entities($key).
'" content="'.encode_entities($value).'" />';
}
+ elsif ($key eq 'name') {
+ push @{$metaheaders{$page}}, scrub('<meta '.$key.'="'.
+ encode_entities($value).
+ join(' ', map { "$_=\"$params{$_}\"" } keys %params).
+ ' />', $destpage);
+ }
else {
- push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key).
- '" content="'.encode_entities($value).'" />', $destpage);
+ push @{$metaheaders{$page}}, scrub('<meta name="'.
+ encode_entities($key).'" content="'.
+ encode_entities($value).'" />', $destpage);
}
return "";
diff --git a/debian/changelog b/debian/changelog
index b6a783787..167d02c6f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ ikiwiki (3.20100723) UNRELEASED; urgency=low
translated languages can be controlled. (intrigeri)
* git: Fix gitweb historyurl examples so "diff to current" links work.
(Thanks jrayhawk)
+ * meta: Allow syntax closer to html meta to be used.
-- Joey Hess <joeyh@debian.org> Fri, 23 Jul 2010 14:00:32 -0400