X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/08cb5f7badff3fdb103cf84890b19b90c0600a4e..57567f41680b80799037cc47c60a09c9a9e0e724:/IkiWiki/Plugin/inline.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 53b051816..ae3f8f409 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -95,7 +95,6 @@ sub preprocess_inline (@) { #{{{ my $atom=($config{atom} && exists $params{atom}) ? yesno($params{atom}) : $config{atom}; my $quick=exists $params{quick} ? yesno($params{quick}) : 0; my $feeds=exists $params{feeds} ? yesno($params{feeds}) : !$quick; - $feeds=0 if $params{preview}; my $feedonly=yesno($params{feedonly}); if (! exists $params{show} && ! $archive) { $params{show}=10; @@ -152,7 +151,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); @@ -226,6 +230,8 @@ sub preprocess_inline (@) { #{{{ $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage})); $template->param(title => pagetitle(basename($page))); $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat})); + $template->param(first => 1) if $page eq $list[0]; + $template->param(last => 1) if $page eq $list[$#list]; if ($actions) { my $file = $pagesources{$page}; @@ -278,7 +284,7 @@ sub preprocess_inline (@) { #{{{ @list=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @list; } - if ($rss) { + if ($rss && ! $params{preview}) { my $rssp=rsspage($params{destpage}).$feednum; will_render($params{destpage}, $rssp); writefile($rssp, $config{destdir}, @@ -286,7 +292,7 @@ sub preprocess_inline (@) { #{{{ $toping{$params{destpage}}=1 unless $config{rebuild}; $feedlinks{$params{destpage}}=qq{}; } - if ($atom) { + if ($atom && ! $params{preview}) { my $atomp=atompage($params{destpage}).$feednum; will_render($params{destpage}, $atomp); writefile($atomp, $config{destdir},