From ba7442b845d7857d69c77bcd512aa4e41dca4a22 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Fri, 23 Oct 2009 19:15:23 -0400 Subject: [PATCH 01/10] had a crack at this tonight --- doc/todo/allow_site-wide_meta_definitions.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/todo/allow_site-wide_meta_definitions.mdwn b/doc/todo/allow_site-wide_meta_definitions.mdwn index 70ccc2b68..57bc7a6fd 100644 --- a/doc/todo/allow_site-wide_meta_definitions.mdwn +++ b/doc/todo/allow_site-wide_meta_definitions.mdwn @@ -72,3 +72,13 @@ my github ikiwiki fork): > by the fact that some (but not all!) meta headers are idempotent. > > --[[smcv]] + +>> Thanks for your comment. Tonight I had a go at implementing the syntax +>> you propose here. I decided the simplest thing to do might be for the scan +>> subroutine to convert any hashes found in the meta_defaults list into calls +>> to the preprocess routine. I've got a bit stuck trying to convert a hash to +>> a named parameter list (or just a subroutine parameter list that is). I may +>> try to look again in the morning (brain a bit sleepy) +>> +>> ...and on writing this comment I see your second suggestion was essentially +>> to do exactly that :) -- [[Jon]] From 9e4fa42676ddc6c8e73469bca52a66245845723c Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Fri, 23 Oct 2009 19:48:04 -0400 Subject: [PATCH 02/10] progress --- doc/todo/allow_site-wide_meta_definitions.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/todo/allow_site-wide_meta_definitions.mdwn b/doc/todo/allow_site-wide_meta_definitions.mdwn index 57bc7a6fd..f935a9acb 100644 --- a/doc/todo/allow_site-wide_meta_definitions.mdwn +++ b/doc/todo/allow_site-wide_meta_definitions.mdwn @@ -82,3 +82,14 @@ my github ikiwiki fork): >> >> ...and on writing this comment I see your second suggestion was essentially >> to do exactly that :) -- [[Jon]] + +>>> ok, it's easier than I thought, I just pass the hash and it's handled +>>> correctly. Right now can't figure out why my hashes get converted into +>>> strings prior to me seeing them in scan(): + + $VAR64 = [ + 'HASH(0xc2daf8)', + 'HASH(0xc2db40)' + ]; + +>>> ...but it *really* is bedtime :) -- [[Jon]] From de59a76e157936e6d95ed6474e188c0fdc353ee4 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 24 Oct 2009 16:49:37 +0100 Subject: [PATCH 03/10] update allow_site-wide_meta_definitions with last night's hacking --- .../allow_site-wide_meta_definitions.mdwn | 147 ++++++++++-------- 1 file changed, 81 insertions(+), 66 deletions(-) diff --git a/doc/todo/allow_site-wide_meta_definitions.mdwn b/doc/todo/allow_site-wide_meta_definitions.mdwn index f935a9acb..3c6c3b5aa 100644 --- a/doc/todo/allow_site-wide_meta_definitions.mdwn +++ b/doc/todo/allow_site-wide_meta_definitions.mdwn @@ -5,54 +5,7 @@ I'd like to define [[plugins/meta]] values to apply across all pages site-wide unless the pages define their own: default values for meta definitions essentially. -Here's a patch to achieve this (also in the "defaultmeta" branch of -my github ikiwiki fork): - - diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm - index b229592..3132257 100644 - --- a/IkiWiki/Plugin/meta.pm - +++ b/IkiWiki/Plugin/meta.pm - @@ -13,6 +13,7 @@ sub import { - hook(type => "needsbuild", id => "meta", call => \&needsbuild); - hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1); - hook(type => "pagetemplate", id => "meta", call => \&pagetemplate); - + hook(type => "scan", id => "meta", call => \&scan); - } - - sub getsetup () { - @@ -302,6 +303,15 @@ sub match { - } - } - - +sub scan() { - + my %params = @_; - + my $page = $params{page}; - + foreach my $type (map { s/^meta_//; $_ } grep /^meta_/, keys %config) { - + $pagestate{$page}{meta}{$type} = $config{"meta_$type"} - + unless defined $pagestate{$page}{meta}{$type}; - + } - +} - + - package IkiWiki::PageSpec; - - sub match_title ($$;@) { - diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn - index 000f461..200c4b2 100644 - --- a/doc/ikiwiki/directive/meta.mdwn - +++ b/doc/ikiwiki/directive/meta.mdwn - @@ -12,6 +12,12 @@ also specifies some additional sub-parameters. - The field values are treated as HTML entity-escaped text, so you can include - a quote in the text by writing `"` and so on. - - +You can also define site-wide defaults for meta values by including them - +in your setup file, e.g. - + - + meta_copyright => "Copyright 2007 by Joey Hess", - + meta_license => "GPL v2+", - + - Supported fields: - - * title + -- [[Jon]] @@ -73,23 +26,85 @@ my github ikiwiki fork): > > --[[smcv]] ->> Thanks for your comment. Tonight I had a go at implementing the syntax ->> you propose here. I decided the simplest thing to do might be for the scan ->> subroutine to convert any hashes found in the meta_defaults list into calls ->> to the preprocess routine. I've got a bit stuck trying to convert a hash to ->> a named parameter list (or just a subroutine parameter list that is). I may ->> try to look again in the morning (brain a bit sleepy) ->> ->> ...and on writing this comment I see your second suggestion was essentially ->> to do exactly that :) -- [[Jon]] +>> Thanks for your comment. I've revised the patch to use the config syntax +>> you suggest. I need to perform some more testing to make sure I've +>> addressed the issues you highlight. +>> +>> I had to patch part of IkiWiki core, the merge routine in Setup, because +>> the use of `possibly_foolish_untaint` was causing the hashrefs at the deep +>> end of the data structure to be converted into strings. The specific change +>> I've made may not be acceptable, though -- I'd appreciate someone providing +>> some feedback on that hunk! ->>> ok, it's easier than I thought, I just pass the hash and it's handled ->>> correctly. Right now can't figure out why my hashes get converted into ->>> strings prior to me seeing them in scan(): + diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm + index 6fe9cda..c4079fd 100644 + --- a/IkiWiki/Plugin/meta.pm + +++ b/IkiWiki/Plugin/meta.pm + @@ -13,6 +13,7 @@ sub import { + hook(type => "needsbuild", id => "meta", call => \&needsbuild); + hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1); + hook(type => "pagetemplate", id => "meta", call => \&pagetemplate); + + hook(type => "scan", id => "meta", call => \&scan); + } + + sub getsetup () { + @@ -305,6 +306,17 @@ sub match { + } + } + + +sub scan() { + + my %params = @_; + + my $page = $params{page}; + + if($config{"meta_defaults"}) { + + foreach my $default (@{$config{"meta_defaults"}}) { + + preprocess(%$default, page => $page, + + destpage => $page, preview => 0); + + } + + } + +} + + + package IkiWiki::PageSpec; + + sub match_title ($$;@) { + diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm + index 8a25ecc..e4d50c9 100644 + --- a/IkiWiki/Setup.pm + +++ b/IkiWiki/Setup.pm + @@ -51,7 +51,13 @@ sub merge ($) { + $config{$c}=$setup{$c}; + } + else { + - $config{$c}=[map { IkiWiki::possibly_foolish_untaint($_) } @{$setup{$c}}] + + $config{$c}=[map { + + if(ref $_ eq 'HASH') { + + $_ + + } else { + + IkiWiki::possibly_foolish_untaint($_) + + } + + } @{$setup{$c}}]; + } + } + elsif (ref $setup{$c} eq 'HASH') { + diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn + index 000f461..8d34ee4 100644 + --- a/doc/ikiwiki/directive/meta.mdwn + +++ b/doc/ikiwiki/directive/meta.mdwn + @@ -12,6 +12,16 @@ also specifies some additional sub-parameters. + The field values are treated as HTML entity-escaped text, so you can include + a quote in the text by writing `"` and so on. + + +You can also define site-wide defaults for meta values by including them + +in your setup file. The key used is `meta_defaults` and the value is a list + +of hashes, one per meta directive. e.g.: + + + + meta_defaults = [ + + { copyright => "Copyright 2007 by Joey Hess" }, + + { license => "GPL v2+" }, + + { link => "somepage", rel => "site entrypoint", }, + + ], + + + Supported fields: + + * title - $VAR64 = [ - 'HASH(0xc2daf8)', - 'HASH(0xc2db40)' - ]; - ->>> ...but it *really* is bedtime :) -- [[Jon]] +>> -- [[Jon]] From 0c28536117d55fbc3a97ea59f1b37e5ef8807a34 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 24 Oct 2009 16:59:41 +0100 Subject: [PATCH 04/10] split the patch out of the page (and minor update it) --- .../allow_site-wide_meta_definitions.mdwn | 75 +------------------ .../current-patch.mdwn | 70 +++++++++++++++++ 2 files changed, 74 insertions(+), 71 deletions(-) create mode 100644 doc/todo/allow_site-wide_meta_definitions/current-patch.mdwn diff --git a/doc/todo/allow_site-wide_meta_definitions.mdwn b/doc/todo/allow_site-wide_meta_definitions.mdwn index 3c6c3b5aa..3d506965f 100644 --- a/doc/todo/allow_site-wide_meta_definitions.mdwn +++ b/doc/todo/allow_site-wide_meta_definitions.mdwn @@ -36,75 +36,8 @@ definitions essentially. >> I've made may not be acceptable, though -- I'd appreciate someone providing >> some feedback on that hunk! - diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm - index 6fe9cda..c4079fd 100644 - --- a/IkiWiki/Plugin/meta.pm - +++ b/IkiWiki/Plugin/meta.pm - @@ -13,6 +13,7 @@ sub import { - hook(type => "needsbuild", id => "meta", call => \&needsbuild); - hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1); - hook(type => "pagetemplate", id => "meta", call => \&pagetemplate); - + hook(type => "scan", id => "meta", call => \&scan); - } - - sub getsetup () { - @@ -305,6 +306,17 @@ sub match { - } - } - - +sub scan() { - + my %params = @_; - + my $page = $params{page}; - + if($config{"meta_defaults"}) { - + foreach my $default (@{$config{"meta_defaults"}}) { - + preprocess(%$default, page => $page, - + destpage => $page, preview => 0); - + } - + } - +} - + - package IkiWiki::PageSpec; - - sub match_title ($$;@) { - diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm - index 8a25ecc..e4d50c9 100644 - --- a/IkiWiki/Setup.pm - +++ b/IkiWiki/Setup.pm - @@ -51,7 +51,13 @@ sub merge ($) { - $config{$c}=$setup{$c}; - } - else { - - $config{$c}=[map { IkiWiki::possibly_foolish_untaint($_) } @{$setup{$c}}] - + $config{$c}=[map { - + if(ref $_ eq 'HASH') { - + $_ - + } else { - + IkiWiki::possibly_foolish_untaint($_) - + } - + } @{$setup{$c}}]; - } - } - elsif (ref $setup{$c} eq 'HASH') { - diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn - index 000f461..8d34ee4 100644 - --- a/doc/ikiwiki/directive/meta.mdwn - +++ b/doc/ikiwiki/directive/meta.mdwn - @@ -12,6 +12,16 @@ also specifies some additional sub-parameters. - The field values are treated as HTML entity-escaped text, so you can include - a quote in the text by writing `"` and so on. - - +You can also define site-wide defaults for meta values by including them - +in your setup file. The key used is `meta_defaults` and the value is a list - +of hashes, one per meta directive. e.g.: - + - + meta_defaults = [ - + { copyright => "Copyright 2007 by Joey Hess" }, - + { license => "GPL v2+" }, - + { link => "somepage", rel => "site entrypoint", }, - + ], - + - Supported fields: - - * title + +[[!inline pages="current-patch" raw=yes quick=yes]] + ->> -- [[Jon]] + -- [[Jon]] diff --git a/doc/todo/allow_site-wide_meta_definitions/current-patch.mdwn b/doc/todo/allow_site-wide_meta_definitions/current-patch.mdwn new file mode 100644 index 000000000..c5e37e76e --- /dev/null +++ b/doc/todo/allow_site-wide_meta_definitions/current-patch.mdwn @@ -0,0 +1,70 @@ +diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm +index 6fe9cda..c4079fd 100644 +--- a/IkiWiki/Plugin/meta.pm ++++ b/IkiWiki/Plugin/meta.pm +@@ -13,6 +13,7 @@ sub import { + hook(type => "needsbuild", id => "meta", call => \&needsbuild); + hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1); + hook(type => "pagetemplate", id => "meta", call => \&pagetemplate); ++ hook(type => "scan", id => "meta", call => \&scan); + } + + sub getsetup () { +@@ -305,6 +306,17 @@ sub match { + } + } + ++sub scan() { ++ my %params = @_; ++ my $page = $params{page}; ++ if($config{"meta_defaults"}) { ++ foreach my $default (@{$config{"meta_defaults"}}) { ++ preprocess(%$default, page => $page, ++ destpage => $page, preview => 0); ++ } ++ } ++} ++ + package IkiWiki::PageSpec; + + sub match_title ($$;@) { +diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm +index 8a25ecc..e4d50c9 100644 +--- a/IkiWiki/Setup.pm ++++ b/IkiWiki/Setup.pm +@@ -51,7 +51,13 @@ sub merge ($) { + $config{$c}=$setup{$c}; + } + else { +- $config{$c}=[map { IkiWiki::possibly_foolish_untaint($_) } @{$setup{$c}}] ++ $config{$c}=[map { ++ if(ref $_ eq 'HASH') { ++ $_ ++ } else { ++ IkiWiki::possibly_foolish_untaint($_) ++ } ++ } @{$setup{$c}}]; + } + } + elsif (ref $setup{$c} eq 'HASH') { +diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn +index 000f461..8d34ee4 100644 +--- a/doc/ikiwiki/directive/meta.mdwn ++++ b/doc/ikiwiki/directive/meta.mdwn +@@ -12,6 +12,16 @@ also specifies some additional sub-parameters. + The field values are treated as HTML entity-escaped text, so you can include + a quote in the text by writing `"` and so on. + ++You can also define site-wide defaults for meta values by including them ++in your setup file. The key used is `meta_defaults` and the value is a list ++of hashes, one per meta directive. e.g.: ++ ++ meta_defaults = [ ++ { copyright => "Copyright 2007 by Joey Hess" }, ++ { license => "GPL v2+" }, ++ { link => "somepage", rel => "site entrypoint", }, ++ ], ++ + Supported fields: + + * title From 6f84c0b5608ccf8faae52040d5ebbeb6b59fb063 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 24 Oct 2009 17:01:20 +0100 Subject: [PATCH 05/10] try to fix my inline --- doc/todo/allow_site-wide_meta_definitions.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/todo/allow_site-wide_meta_definitions.mdwn b/doc/todo/allow_site-wide_meta_definitions.mdwn index 3d506965f..f56bf5c3c 100644 --- a/doc/todo/allow_site-wide_meta_definitions.mdwn +++ b/doc/todo/allow_site-wide_meta_definitions.mdwn @@ -37,7 +37,7 @@ definitions essentially. >> some feedback on that hunk! -[[!inline pages="current-patch" raw=yes quick=yes]] +[[!inline pages="allow site-wide meta definitions/current-patch" raw=yes quick=yes]] -- [[Jon]] From b474e61eee26c5f0f7c9537562a9d6c2be0ad68f Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 24 Oct 2009 17:22:01 +0100 Subject: [PATCH 06/10] try to fix my inline, second attempt --- doc/todo/allow_site-wide_meta_definitions.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/todo/allow_site-wide_meta_definitions.mdwn b/doc/todo/allow_site-wide_meta_definitions.mdwn index f56bf5c3c..2e8296640 100644 --- a/doc/todo/allow_site-wide_meta_definitions.mdwn +++ b/doc/todo/allow_site-wide_meta_definitions.mdwn @@ -37,7 +37,7 @@ definitions essentially. >> some feedback on that hunk! -[[!inline pages="allow site-wide meta definitions/current-patch" raw=yes quick=yes]] +[[!inline pages="allow_site-wide_meta_definitions/current-patch" raw=yes quick=yes]] -- [[Jon]] From 118058f0f530f0171fb625815aa0aae992e3f4b6 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 24 Oct 2009 17:23:52 +0100 Subject: [PATCH 07/10] give up and just inline the patch again --- .../allow_site-wide_meta_definitions.mdwn | 74 ++++++++++++++++++- .../current-patch.mdwn | 70 ------------------ 2 files changed, 71 insertions(+), 73 deletions(-) delete mode 100644 doc/todo/allow_site-wide_meta_definitions/current-patch.mdwn diff --git a/doc/todo/allow_site-wide_meta_definitions.mdwn b/doc/todo/allow_site-wide_meta_definitions.mdwn index 2e8296640..d95f8bf13 100644 --- a/doc/todo/allow_site-wide_meta_definitions.mdwn +++ b/doc/todo/allow_site-wide_meta_definitions.mdwn @@ -36,8 +36,76 @@ definitions essentially. >> I've made may not be acceptable, though -- I'd appreciate someone providing >> some feedback on that hunk! - -[[!inline pages="allow_site-wide_meta_definitions/current-patch" raw=yes quick=yes]] - + + diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm + index 6fe9cda..c4079fd 100644 + --- a/IkiWiki/Plugin/meta.pm + +++ b/IkiWiki/Plugin/meta.pm + @@ -13,6 +13,7 @@ sub import { + hook(type => "needsbuild", id => "meta", call => \&needsbuild); + hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1); + hook(type => "pagetemplate", id => "meta", call => \&pagetemplate); + + hook(type => "scan", id => "meta", call => \&scan); + } + + sub getsetup () { + @@ -305,6 +306,17 @@ sub match { + } + } + + +sub scan() { + + my %params = @_; + + my $page = $params{page}; + + if($config{"meta_defaults"}) { + + foreach my $default (@{$config{"meta_defaults"}}) { + + preprocess(%$default, page => $page, + + destpage => $page, preview => 0); + + } + + } + +} + + + package IkiWiki::PageSpec; + + sub match_title ($$;@) { + diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm + index 8a25ecc..e4d50c9 100644 + --- a/IkiWiki/Setup.pm + +++ b/IkiWiki/Setup.pm + @@ -51,7 +51,13 @@ sub merge ($) { + $config{$c}=$setup{$c}; + } + else { + - $config{$c}=[map { IkiWiki::possibly_foolish_untaint($_) } @{$setup{$c}}] + + $config{$c}=[map { + + if(ref $_ eq 'HASH') { + + $_ + + } else { + + IkiWiki::possibly_foolish_untaint($_) + + } + + } @{$setup{$c}}]; + } + } + elsif (ref $setup{$c} eq 'HASH') { + diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn + index 000f461..8d34ee4 100644 + --- a/doc/ikiwiki/directive/meta.mdwn + +++ b/doc/ikiwiki/directive/meta.mdwn + @@ -12,6 +12,16 @@ also specifies some additional sub-parameters. + The field values are treated as HTML entity-escaped text, so you can include + a quote in the text by writing `"` and so on. + + +You can also define site-wide defaults for meta values by including them + +in your setup file. The key used is `meta_defaults` and the value is a list + +of hashes, one per meta directive. e.g.: + + + + meta_defaults = [ + + { copyright => "Copyright 2007 by Joey Hess" }, + + { license => "GPL v2+" }, + + { link => "somepage", rel => "site entrypoint", }, + + ], + + + Supported fields: + + * title -- [[Jon]] diff --git a/doc/todo/allow_site-wide_meta_definitions/current-patch.mdwn b/doc/todo/allow_site-wide_meta_definitions/current-patch.mdwn deleted file mode 100644 index c5e37e76e..000000000 --- a/doc/todo/allow_site-wide_meta_definitions/current-patch.mdwn +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm -index 6fe9cda..c4079fd 100644 ---- a/IkiWiki/Plugin/meta.pm -+++ b/IkiWiki/Plugin/meta.pm -@@ -13,6 +13,7 @@ sub import { - hook(type => "needsbuild", id => "meta", call => \&needsbuild); - hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1); - hook(type => "pagetemplate", id => "meta", call => \&pagetemplate); -+ hook(type => "scan", id => "meta", call => \&scan); - } - - sub getsetup () { -@@ -305,6 +306,17 @@ sub match { - } - } - -+sub scan() { -+ my %params = @_; -+ my $page = $params{page}; -+ if($config{"meta_defaults"}) { -+ foreach my $default (@{$config{"meta_defaults"}}) { -+ preprocess(%$default, page => $page, -+ destpage => $page, preview => 0); -+ } -+ } -+} -+ - package IkiWiki::PageSpec; - - sub match_title ($$;@) { -diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm -index 8a25ecc..e4d50c9 100644 ---- a/IkiWiki/Setup.pm -+++ b/IkiWiki/Setup.pm -@@ -51,7 +51,13 @@ sub merge ($) { - $config{$c}=$setup{$c}; - } - else { -- $config{$c}=[map { IkiWiki::possibly_foolish_untaint($_) } @{$setup{$c}}] -+ $config{$c}=[map { -+ if(ref $_ eq 'HASH') { -+ $_ -+ } else { -+ IkiWiki::possibly_foolish_untaint($_) -+ } -+ } @{$setup{$c}}]; - } - } - elsif (ref $setup{$c} eq 'HASH') { -diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn -index 000f461..8d34ee4 100644 ---- a/doc/ikiwiki/directive/meta.mdwn -+++ b/doc/ikiwiki/directive/meta.mdwn -@@ -12,6 +12,16 @@ also specifies some additional sub-parameters. - The field values are treated as HTML entity-escaped text, so you can include - a quote in the text by writing `"` and so on. - -+You can also define site-wide defaults for meta values by including them -+in your setup file. The key used is `meta_defaults` and the value is a list -+of hashes, one per meta directive. e.g.: -+ -+ meta_defaults = [ -+ { copyright => "Copyright 2007 by Joey Hess" }, -+ { license => "GPL v2+" }, -+ { link => "somepage", rel => "site entrypoint", }, -+ ], -+ - Supported fields: - - * title From 128e31d658b67411168775dcf8d9b9c9675e28cc Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 24 Oct 2009 17:27:48 +0100 Subject: [PATCH 08/10] inline the correct patch, and then go shopping --- .../allow_site-wide_meta_definitions.mdwn | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/doc/todo/allow_site-wide_meta_definitions.mdwn b/doc/todo/allow_site-wide_meta_definitions.mdwn index d95f8bf13..20c8c02ac 100644 --- a/doc/todo/allow_site-wide_meta_definitions.mdwn +++ b/doc/todo/allow_site-wide_meta_definitions.mdwn @@ -36,31 +36,29 @@ definitions essentially. >> I've made may not be acceptable, though -- I'd appreciate someone providing >> some feedback on that hunk! - diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm - index 6fe9cda..c4079fd 100644 + index 6fe9cda..2f8c098 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm - @@ -13,6 +13,7 @@ sub import { + @@ -13,6 +13,8 @@ sub import { hook(type => "needsbuild", id => "meta", call => \&needsbuild); hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1); hook(type => "pagetemplate", id => "meta", call => \&pagetemplate); - + hook(type => "scan", id => "meta", call => \&scan); + + hook(type => "scan", id => "meta", call => \&scan) + + if $config{"meta_defaults"}; } sub getsetup () { - @@ -305,6 +306,17 @@ sub match { + @@ -305,6 +307,15 @@ sub match { } } +sub scan() { + my %params = @_; + my $page = $params{page}; - + if($config{"meta_defaults"}) { - + foreach my $default (@{$config{"meta_defaults"}}) { - + preprocess(%$default, page => $page, - + destpage => $page, preview => 0); - + } + + foreach my $default (@{$config{"meta_defaults"}}) { + + preprocess(%$default, page => $page, + + destpage => $page, preview => 0); + } +} + @@ -108,4 +106,4 @@ definitions essentially. * title - -- [[Jon]] +-- [[Jon]] From 0dbb16fd5a9f573c6b49006f7452cd60474d9803 Mon Sep 17 00:00:00 2001 From: PaulePanter Date: Sun, 25 Oct 2009 10:32:49 -0400 Subject: [PATCH 09/10] Typo. --- doc/ikiwiki/directive/comment.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ikiwiki/directive/comment.mdwn b/doc/ikiwiki/directive/comment.mdwn index 21386dfc3..693a92770 100644 --- a/doc/ikiwiki/directive/comment.mdwn +++ b/doc/ikiwiki/directive/comment.mdwn @@ -32,7 +32,7 @@ metadata of the comment. * `ip` - Can be used to record the IP address of a commenter, if they posted anonymously. * `claimedauthor` - Records the name that the user entered, - if anonmous commenters are allowed to enter their (unverified) + if anonymous commenters are allowed to enter their (unverified) name. [[!meta robots="noindex, follow"]] From b54b8215d0c150410e4a629caa9b0035d69f89b2 Mon Sep 17 00:00:00 2001 From: PaulePanter Date: Sun, 25 Oct 2009 16:13:24 -0400 Subject: [PATCH 10/10] Question about interaction of `feedshow` and `show`. --- doc/ikiwiki/directive/inline/discussion.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/ikiwiki/directive/inline/discussion.mdwn b/doc/ikiwiki/directive/inline/discussion.mdwn index be0665d04..e5cfeb91c 100644 --- a/doc/ikiwiki/directive/inline/discussion.mdwn +++ b/doc/ikiwiki/directive/inline/discussion.mdwn @@ -124,3 +124,19 @@ My index page has: Else can you please suggest a smarter way of getting certain data out from pages for a inline index? --[[hendry]] + +--- + +## Interaction of `show` and `feedshow` + +Reading the documentation I would think that `feedshow` does not +influence `show`. + + [[!inline pages="./blog/*" archive=yes quick=yes feedshow=10 sort=title reverse=yes]] + +Only ten pages are listed in this example although `archive` is set to +yes. Removing `feedshow=10` all matching pages are shown. + +Is that behaviour intended? + +--[[PaulePanter]]