]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/inline.pm
Merge branch 'master' of ssh://git.kitenet.net/srv/git/ikiwiki.info
[ikiwiki.git] / IkiWiki / Plugin / inline.pm
index 3c0c6f140709b9e91fdbb8b13fa86c08ee400d96..59eabb606e9967a0a3fb58bc5f0f338a3339f405 100644 (file)
@@ -14,7 +14,7 @@ my %page_numfeeds;
 sub import { #{{{
        hook(type => "getopt", id => "inline", call => \&getopt);
        hook(type => "checkconfig", id => "inline", call => \&checkconfig);
-       hook(type => "sessioncgi", id => "skeleton", call => \&sessioncgi);
+       hook(type => "sessioncgi", id => "inline", call => \&sessioncgi);
        hook(type => "preprocess", id => "inline", 
                call => \&IkiWiki::preprocess_inline);
        hook(type => "pagetemplate", id => "inline",
@@ -152,7 +152,12 @@ sub preprocess_inline (@) { #{{{
        # that if they are removed or otherwise changed, the inline will be
        # sure to be updated.
        add_depends($params{page}, join(" or ", @list));
-       
+       # Force a scan of this page so any metadata that appears after this
+       # inline directive is available when inlining. The page normally 
+       # wouldn't be scanned if it's only being rebuilt because of a
+       # depedency.
+       IkiWiki::scan($pagesources{$params{page}});
+
        my $feednum="";
 
        my $feedid=join("\0", map { $_."\0".$params{$_} } sort keys %params);
@@ -173,8 +178,8 @@ sub preprocess_inline (@) { #{{{
                }
        }
 
-       my $rssurl=basename(rsspage($params{destpage}).$feednum);
-       my $atomurl=basename(atompage($params{destpage}).$feednum);
+       my $rssurl=basename(rsspage($params{destpage}).$feednum) if $feeds && $rss;
+       my $atomurl=basename(atompage($params{destpage}).$feednum) if $feeds && $atom;
        my $ret="";
 
        if ($config{cgiurl} && (exists $params{rootpage} ||