web commit by cworth
[ikiwiki.git] / doc / todo / Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn
1 I don't segregate my blog entries into a directory, but instead want
2 my blog to simply consist of all pages that have been tagged. That is,
3 I'd like to have my blog page look like this:
4
5         \[[inline pages="link(tag/*)"]]
6
7 That doesn't work in ikiwiki 2.1, but I have it
8 [working](http://www.cworth.org/blog) with the following patch:
9
10         From 6149386084417fb8375d08446438b20ed52d6882 Mon Sep 17 00:00:00 2001
11         From: Carl Worth <cworth@cworth.org>
12         Date: Tue, 29 May 2007 11:43:21 -0700
13         Subject: [PATCH] Allow for glob matching inside of link() within a pagespec
14         
15         ---
16          IkiWiki.pm |   11 ++++++++---
17          1 files changed, 8 insertions(+), 3 deletions(-)
18         
19         diff --git a/IkiWiki.pm b/IkiWiki.pm
20         index 38aa46a..cd42e8d 100644
21         --- a/IkiWiki.pm
22         +++ b/IkiWiki.pm
23         @@ -1082,10 +1082,15 @@ sub match_link ($$;@) { #{{{
24                 my $links = $IkiWiki::links{$page} or return undef;
25                 return IkiWiki::FailReason->new("$page has no links") unless @$links;
26                 my $bestlink = IkiWiki::bestlink($from, $link);
27         -       return IkiWiki::FailReason->new("no such link") unless length $bestlink;
28                 foreach my $p (@$links) {
29         -               return IkiWiki::SuccessReason->new("$page links to $link")
30         -                       if $bestlink eq IkiWiki::bestlink($page, $p);
31         +               if (length $bestlink) {
32         +                       return IkiWiki::SuccessReason->new("$page links to $link")
33         +                               if $bestlink eq IkiWiki::bestlink($page, $p);
34         +               }
35         +               else {
36         +                       return IkiWiki::SuccessReason->new("$page links to page matching $link")
37         +                               if match_glob ($p, $link, %params);
38         +               }
39                 }
40                 return IkiWiki::FailReason->new("$page does not link to $link");
41          } #}}}
42         -- 
43         1.5.1.1.g6aead