X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/bf522a347f9749522a4f575cb48000123b79978a..44d4f086efcd5e777e100eeca078fc6eafaf9476:/IkiWiki/Plugin/inline.pm
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index e2be5640e..c7107d664 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -153,11 +153,6 @@ 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="";
@@ -183,7 +178,7 @@ sub preprocess_inline (@) { #{{{
my $atomurl=basename(atompage($params{destpage}).$feednum) if $feeds && $atom;
my $ret="";
- if ($config{cgiurl} && (exists $params{rootpage} ||
+ if ($config{cgiurl} && ! $params{preview} && (exists $params{rootpage} ||
(exists $params{postform} && yesno($params{postform})))) {
# Add a blog post form, with feed buttons.
my $formtemplate=template("blogpost.tmpl", blind_cache => 1);
@@ -202,7 +197,7 @@ sub preprocess_inline (@) { #{{{
}
$ret.=$formtemplate->output;
}
- elsif ($feeds) {
+ elsif ($feeds && !$params{preview}) {
# Add feed buttons.
my $linktemplate=template("feedlink.tmpl", blind_cache => 1);
$linktemplate->param(rssurl => $rssurl) if $rss;
@@ -286,21 +281,26 @@ sub preprocess_inline (@) { #{{{
@list=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @list;
}
- if ($rss && ! $params{preview}) {
+ if ($rss) {
my $rssp=rsspage($params{destpage}).$feednum;
will_render($params{destpage}, $rssp);
- writefile($rssp, $config{destdir},
- genfeed("rss", $rssurl, $desc, $params{destpage}, @list));
- $toping{$params{destpage}}=1 unless $config{rebuild};
- $feedlinks{$params{destpage}}=qq{};
+ if (! $params{preview}) {
+ writefile($rssp, $config{destdir},
+ genfeed("rss",
+ $config{url}."/".rsspage($params{destpage}).$feednum, $desc, $params{destpage}, @list));
+ $toping{$params{destpage}}=1 unless $config{rebuild};
+ $feedlinks{$params{destpage}}=qq{};
+ }
}
- if ($atom && ! $params{preview}) {
+ if ($atom) {
my $atomp=atompage($params{destpage}).$feednum;
will_render($params{destpage}, $atomp);
- writefile($atomp, $config{destdir},
- genfeed("atom", $atomurl, $desc, $params{destpage}, @list));
- $toping{$params{destpage}}=1 unless $config{rebuild};
- $feedlinks{$params{destpage}}=qq{};
+ if (! $params{preview}) {
+ writefile($atomp, $config{destdir},
+ genfeed("atom", $config{url}."/".atompage($params{destpage}).$feednum, $desc, $params{destpage}, @list));
+ $toping{$params{destpage}}=1 unless $config{rebuild};
+ $feedlinks{$params{destpage}}=qq{};
+ }
}
}
@@ -363,8 +363,8 @@ sub absolute_urls ($$) { #{{{
$url=~s/[^\/]+$//;
$content=~s/(