aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2010-04-06 00:58:55 +0100
committerSimon McVittie <smcv@debian.org>2010-04-06 00:58:55 +0100
commitbe1d97c0bd495fe876853d7d7f6eb42041867649 (patch)
tree3571f9649d39c0f4049bc372d24145a24c0cf934 /IkiWiki
parentcb8b2f80b2f8c91eba3f3a6a5b9913ab80326df8 (diff)
downloadikiwiki-be1d97c0bd495fe876853d7d7f6eb42041867649.tar
ikiwiki-be1d97c0bd495fe876853d7d7f6eb42041867649.tar.gz
Only store titlesort in meta pagestate if it differs from title
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/meta.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 553f93455..7f19b46a3 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -88,13 +88,18 @@ sub preprocess (@) {
# Metadata collection that needs to happen during the scan pass.
if ($key eq 'title') {
- $pagestate{$page}{meta}{title}=HTML::Entities::encode_numeric($value);
+ my $encoded = HTML::Entities::encode_numeric($value);
+ $pagestate{$page}{meta}{title} = $encoded;
+
if (exists $params{sortas}) {
$pagestate{$page}{meta}{titlesort}=$params{sortas};
}
- else {
+ elsif ($encoded ne $value) {
$pagestate{$page}{meta}{titlesort}=$value;
}
+ else {
+ delete $pagestate{$page}{meta}{titlesort};
+ }
return "";
}
elsif ($key eq 'description') {