From: Simon McVittie Date: Sat, 3 Apr 2010 13:19:18 +0000 (+0100) Subject: Rename sort parameter to meta title/author to sortas=bar X-Git-Tag: 3.20100427~203^2~3 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/490f95616a8a49f2120655d07c282eefd067e640 Rename sort parameter to meta title/author to sortas=bar Joey pointed out that sort=x usually takes a sort order. --- diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index c9fdbc934..4992617d0 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -89,8 +89,8 @@ 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); - if (exists $params{sort}) { - $pagestate{$page}{meta}{titlesort}=$params{sort}; + if (exists $params{sortas}) { + $pagestate{$page}{meta}{titlesort}=$params{sortas}; } else { $pagestate{$page}{meta}{titlesort}=$value; @@ -122,8 +122,8 @@ sub preprocess (@) { } elsif ($key eq 'author') { $pagestate{$page}{meta}{author}=$value; - if (exists $params{sort}) { - $pagestate{$page}{meta}{authorsort}=$params{sort}; + if (exists $params{sortas}) { + $pagestate{$page}{meta}{authorsort}=$params{sortas}; } else { $pagestate{$page}{meta}{authorsort}=$value; diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn index c5f74fac5..5a3919dea 100644 --- a/doc/ikiwiki/directive/meta.mdwn +++ b/doc/ikiwiki/directive/meta.mdwn @@ -23,12 +23,12 @@ Supported fields: be set to a true value in the template; this can be used to format things differently in this case. - An optional `sort` parameter will be used preferentially when + An optional `sortas` parameter will be used preferentially when [[ikiwiki/pagespec/sorting]] by `meta(title)`: - \[[!meta title="The Beatles" sort="Beatles, The"]] + \[[!meta title="The Beatles" sortas="Beatles, The"]] - \[[!meta title="David Bowie" sort="Bowie, David"]] + \[[!meta title="David Bowie" sortas="Bowie, David"]] * license @@ -44,10 +44,10 @@ Supported fields: Specifies the author of a page. - An optional `sort` parameter will be used preferentially when + An optional `sortas` parameter will be used preferentially when [[ikiwiki/pagespec/sorting]] by `meta(author)`: - \[[!meta author="Joey Hess" sort="Hess, Joey"]] + \[[!meta author="Joey Hess" sortas="Hess, Joey"]] * authorurl diff --git a/doc/ikiwiki/pagespec/sorting.mdwn b/doc/ikiwiki/pagespec/sorting.mdwn index fbf598340..5c6cfcc2b 100644 --- a/doc/ikiwiki/pagespec/sorting.mdwn +++ b/doc/ikiwiki/pagespec/sorting.mdwn @@ -11,7 +11,7 @@ orders can be specified. as such, ("1 2 9 10 20" instead of "1 10 2 20 9") """]] [[!if test="enabled(meta)" then=""" -* `meta(title)` - Order according to the `\[[!meta title="foo" sort="bar"]]` +* `meta(title)` - Order according to the `\[[!meta title="foo" sortas="bar"]]` or `\[[!meta title="foo"]]` [[ikiwiki/directive]], or the page name if no full title was set. `meta(author)`, `meta(date)`, `meta(updated)`, etc. also work.