1 diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
2 index 6fe9cda..c4079fd 100644
3 --- a/IkiWiki/Plugin/meta.pm
4 +++ b/IkiWiki/Plugin/meta.pm
5 @@ -13,6 +13,7 @@ sub import {
6 hook(type => "needsbuild", id => "meta", call => \&needsbuild);
7 hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
8 hook(type => "pagetemplate", id => "meta", call => \&pagetemplate);
9 + hook(type => "scan", id => "meta", call => \&scan);
13 @@ -305,6 +306,17 @@ sub match {
19 + my $page = $params{page};
20 + if($config{"meta_defaults"}) {
21 + foreach my $default (@{$config{"meta_defaults"}}) {
22 + preprocess(%$default, page => $page,
23 + destpage => $page, preview => 0);
28 package IkiWiki::PageSpec;
30 sub match_title ($$;@) {
31 diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm
32 index 8a25ecc..e4d50c9 100644
33 --- a/IkiWiki/Setup.pm
34 +++ b/IkiWiki/Setup.pm
35 @@ -51,7 +51,13 @@ sub merge ($) {
36 $config{$c}=$setup{$c};
39 - $config{$c}=[map { IkiWiki::possibly_foolish_untaint($_) } @{$setup{$c}}]
41 + if(ref $_ eq 'HASH') {
44 + IkiWiki::possibly_foolish_untaint($_)
49 elsif (ref $setup{$c} eq 'HASH') {
50 diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn
51 index 000f461..8d34ee4 100644
52 --- a/doc/ikiwiki/directive/meta.mdwn
53 +++ b/doc/ikiwiki/directive/meta.mdwn
54 @@ -12,6 +12,16 @@ also specifies some additional sub-parameters.
55 The field values are treated as HTML entity-escaped text, so you can include
56 a quote in the text by writing `"` and so on.
58 +You can also define site-wide defaults for meta values by including them
59 +in your setup file. The key used is `meta_defaults` and the value is a list
60 +of hashes, one per meta directive. e.g.:
63 + { copyright => "Copyright 2007 by Joey Hess" },
64 + { license => "GPL v2+" },
65 + { link => "somepage", rel => "site entrypoint", },