aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2012-03-30 13:38:52 -0400
committerJoey Hess <joey@kitenet.net>2012-04-01 14:39:27 -0400
commit89df287aaa0a21d959dc2c179412a16ab08a7d51 (patch)
tree8187df956c8682e75bdae2a602847661f1176abe /IkiWiki
parent0cd67c515fad03797fa7792c10b507a0abb77c28 (diff)
downloadikiwiki-89df287aaa0a21d959dc2c179412a16ab08a7d51.tar
ikiwiki-89df287aaa0a21d959dc2c179412a16ab08a7d51.tar.gz
meta: Support keywords header. Closes: #664780 Thanks, Martin Michlmayr
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/meta.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 28b1a1ad6..b19ea2b32 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -285,6 +285,13 @@ sub preprocess (@) {
join(' ', map { "$_=\"$params{$_}\"" } keys %params).
' />', $page, $destpage);
}
+ elsif ($key eq 'keywords') {
+ # Make sure the keyword string is safe: only allow alphanumeric
+ # characters, space and comma and strip the rest.
+ $value =~ s/[^[:alnum:], ]+//g;
+ push @{$metaheaders{$page}}, '<meta name="keywords"'.
+ ' content="'.encode_entities($value).'" />';
+ }
else {
push @{$metaheaders{$page}}, scrub('<meta name="'.
encode_entities($key).'" content="'.