]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
authorJoey Hess <joey@gnu.kitenet.net>
Mon, 16 Nov 2009 20:54:28 +0000 (15:54 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Mon, 16 Nov 2009 20:54:28 +0000 (15:54 -0500)
IkiWiki/Plugin/meta.pm
debian/changelog
doc/ikiwiki/directive/map.mdwn
doc/ikiwiki/directive/meta.mdwn

index 6fe9cda3424a6b85ba92f1b975f568b5e7eaaa40..55c9ddbd1482f8d47007c4e1b66cf2ea6d2f2332 100644 (file)
@@ -88,7 +88,7 @@ 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);
-               # fallthrough
+               return "";
        }
        elsif ($key eq 'description') {
                $pagestate{$page}{meta}{description}=HTML::Entities::encode_numeric($value);
@@ -239,6 +239,10 @@ sub preprocess (@) {
                push @{$metaheaders{$page}}, '<meta name="robots"'.
                        ' content="'.encode_entities($value).'" />';
        }
+       elsif ($key eq 'description') {
+               push @{$metaheaders{$page}}, '<meta name="'.encode_entities($key).
+                       '" content="'.encode_entities($value).'" />';
+       }
        else {
                push @{$metaheaders{$page}}, scrub('<meta name="'.encode_entities($key).
                        '" content="'.encode_entities($value).'" />', $destpage);
@@ -263,7 +267,7 @@ sub pagetemplate (@) {
                $template->param(title_overridden => 1);
        }
 
-       foreach my $field (qw{author authorurl permalink}) {
+       foreach my $field (qw{author authorurl description permalink}) {
                $template->param($field => $pagestate{$page}{meta}{$field})
                        if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field);
        }
index ad80d37b75e83f466df081928284c0c713a6cc9a..1abd4de4dc4c8244049442d83c5762657f62ea52 100644 (file)
@@ -1,3 +1,12 @@
+ikiwiki (3.20091114) UNRELEASED; urgency=low
+
+  * meta: Generate meta description tags even when the html scrubber is
+    enabled.
+  * meta: Allow use of DESCRIPTION in templates to get at the meta description
+    value. (Thanks, NicolasLimare)
+
+ -- Joey Hess <joeyh@debian.org>  Mon, 16 Nov 2009 15:46:45 -0500
+
 ikiwiki (3.20091113) unstable; urgency=low
 
   * underlay: Fix example values put in setup file to be array
index 09c95a0c99917d0226cbef596df662e2e3e97e33..4b6499547f71fcd95f1e4380d1ed9016ad5d729b 100644 (file)
@@ -13,6 +13,8 @@ the [[meta]] directive). For example:
 
        \[[!map pages="* and !blog/* and !*/Discussion" show=title]]
 
+       \[[!map pages="* and !blog/* and !*/Discussion" show=description]]
+
 Hint: To limit the map to displaying pages less than a certain level deep,
 use a [[ikiwiki/PageSpec]] like this: `pages="* and !*/*/*"`
 
index 000f461c9751f9fba13f7eba71880568819c654c..557441c0b8dbe424a62657d38b156a36fba92482 100644 (file)
@@ -43,8 +43,8 @@ Supported fields:
 
 * description
 
-  Specifies a "description" of the page. You could use this to provide
-  a summary, for example, to be picked up by the [[map]] directive.
+  Specifies a short description for the page. This will be put in
+  the html header, and can also be displayed by eg, the [[map]] directive.
 
 * permalink