* inline: add feedonly option, set feedonly=yes to get only the feed button
but not inline the pages.master
parent
23d38e0276
commit
95199c5b04
|
@ -93,6 +93,7 @@ sub preprocess_inline (@) { #{{{
|
|||
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;
|
||||
}
|
||||
|
@ -180,66 +181,68 @@ sub preprocess_inline (@) { #{{{
|
|||
$ret.=$linktemplate->output;
|
||||
}
|
||||
|
||||
require HTML::Template;
|
||||
my @params=IkiWiki::template_params($params{template}.".tmpl", blind_cache => 1);
|
||||
if (! @params) {
|
||||
return sprintf(gettext("nonexistant template %s"), $params{template});
|
||||
}
|
||||
my $template=HTML::Template->new(@params) unless $raw;
|
||||
if (! $feedonly) {
|
||||
require HTML::Template;
|
||||
my @params=IkiWiki::template_params($params{template}.".tmpl", blind_cache => 1);
|
||||
if (! @params) {
|
||||
return sprintf(gettext("nonexistant template %s"), $params{template});
|
||||
}
|
||||
my $template=HTML::Template->new(@params) unless $raw;
|
||||
|
||||
foreach my $page (@list) {
|
||||
my $file = $pagesources{$page};
|
||||
my $type = pagetype($file);
|
||||
if (! $raw || ($raw && ! defined $type)) {
|
||||
unless ($archive && $quick) {
|
||||
# Get the content before populating the
|
||||
# template, since getting the content uses
|
||||
# the same template if inlines are nested.
|
||||
my $content=get_inline_content($page, $params{destpage});
|
||||
$template->param(content => $content);
|
||||
}
|
||||
$template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
|
||||
$template->param(title => pagetitle(basename($page)));
|
||||
$template->param(ctime => displaytime($pagectime{$page}));
|
||||
|
||||
if ($actions) {
|
||||
my $file = $pagesources{$page};
|
||||
my $type = pagetype($file);
|
||||
if ($config{discussion}) {
|
||||
my $discussionlink=gettext("discussion");
|
||||
if ($page !~ /.*\/\Q$discussionlink\E$/ &&
|
||||
(length $config{cgiurl} ||
|
||||
exists $links{$page."/".$discussionlink})) {
|
||||
foreach my $page (@list) {
|
||||
my $file = $pagesources{$page};
|
||||
my $type = pagetype($file);
|
||||
if (! $raw || ($raw && ! defined $type)) {
|
||||
unless ($archive && $quick) {
|
||||
# Get the content before populating the
|
||||
# template, since getting the content uses
|
||||
# the same template if inlines are nested.
|
||||
my $content=get_inline_content($page, $params{destpage});
|
||||
$template->param(content => $content);
|
||||
}
|
||||
$template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
|
||||
$template->param(title => pagetitle(basename($page)));
|
||||
$template->param(ctime => displaytime($pagectime{$page}));
|
||||
|
||||
if ($actions) {
|
||||
my $file = $pagesources{$page};
|
||||
my $type = pagetype($file);
|
||||
if ($config{discussion}) {
|
||||
my $discussionlink=gettext("discussion");
|
||||
if ($page !~ /.*\/\Q$discussionlink\E$/ &&
|
||||
(length $config{cgiurl} ||
|
||||
exists $links{$page."/".$discussionlink})) {
|
||||
$template->param(have_actions => 1);
|
||||
$template->param(discussionlink =>
|
||||
htmllink($page,
|
||||
$params{page},
|
||||
gettext("Discussion"),
|
||||
noimageinline => 1,
|
||||
forcesubpage => 1));
|
||||
}
|
||||
}
|
||||
if (length $config{cgiurl} && defined $type) {
|
||||
$template->param(have_actions => 1);
|
||||
$template->param(discussionlink =>
|
||||
htmllink($page,
|
||||
$params{page},
|
||||
gettext("Discussion"),
|
||||
noimageinline => 1,
|
||||
forcesubpage => 1));
|
||||
$template->param(editurl => cgiurl(do => "edit", page => pagetitle($page, 1)));
|
||||
}
|
||||
}
|
||||
if (length $config{cgiurl} && defined $type) {
|
||||
$template->param(have_actions => 1);
|
||||
$template->param(editurl => cgiurl(do => "edit", page => pagetitle($page, 1)));
|
||||
}
|
||||
|
||||
run_hooks(pagetemplate => sub {
|
||||
shift->(page => $page, destpage => $params{page},
|
||||
template => $template,);
|
||||
});
|
||||
|
||||
$ret.=$template->output;
|
||||
$template->clear_params;
|
||||
}
|
||||
|
||||
run_hooks(pagetemplate => sub {
|
||||
shift->(page => $page, destpage => $params{page},
|
||||
template => $template,);
|
||||
});
|
||||
|
||||
$ret.=$template->output;
|
||||
$template->clear_params;
|
||||
}
|
||||
else {
|
||||
if (defined $type) {
|
||||
$ret.="\n".
|
||||
linkify($page, $params{page},
|
||||
preprocess($page, $params{page},
|
||||
filter($page, $params{page},
|
||||
readfile(srcfile($file)))));
|
||||
else {
|
||||
if (defined $type) {
|
||||
$ret.="\n".
|
||||
linkify($page, $params{page},
|
||||
preprocess($page, $params{page},
|
||||
filter($page, $params{page},
|
||||
readfile(srcfile($file)))));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,10 @@ ikiwiki (2.8) UNRELEASED; urgency=low
|
|||
|
||||
* Redid the debian/copyright file, using the proposed new copyright file
|
||||
format. Included many details not previously listed in the old file.
|
||||
* inline: add feedonly option, set feedonly=yes to get only the feed button
|
||||
but not inline the pages.
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Mon, 10 Sep 2007 20:25:40 -0400
|
||||
-- Joey Hess <joeyh@debian.org> Thu, 13 Sep 2007 18:07:51 -0400
|
||||
|
||||
ikiwiki (2.7) unstable; urgency=low
|
||||
|
||||
|
|
|
@ -91,3 +91,5 @@ directive:
|
|||
specifying a tighter [[PageSpec]] here.
|
||||
* `feedshow` - Specify the maximum number of matching pages to include in
|
||||
the rss/atom feeds. The default is the same as the `show` value above,
|
||||
* `feedonly` - Only generate the feed, do not display the pages inline on
|
||||
the page.
|
||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2007-09-07 13:04-0400\n"
|
||||
"POT-Creation-Date: 2007-09-13 18:22-0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -42,7 +42,7 @@ msgid "%s is not an editable page"
|
|||
msgstr ""
|
||||
|
||||
#: ../IkiWiki/CGI.pm:441 ../IkiWiki/Plugin/brokenlinks.pm:24
|
||||
#: ../IkiWiki/Plugin/inline.pm:209 ../IkiWiki/Plugin/opendiscussion.pm:17
|
||||
#: ../IkiWiki/Plugin/inline.pm:211 ../IkiWiki/Plugin/opendiscussion.pm:17
|
||||
#: ../IkiWiki/Plugin/orphans.pm:28 ../IkiWiki/Render.pm:99
|
||||
#: ../IkiWiki/Render.pm:179
|
||||
msgid "discussion"
|
||||
|
@ -177,25 +177,25 @@ msgstr ""
|
|||
msgid "Must specify url to wiki with --url when using --rss or --atom"
|
||||
msgstr ""
|
||||
|
||||
#: ../IkiWiki/Plugin/inline.pm:131
|
||||
#: ../IkiWiki/Plugin/inline.pm:132
|
||||
#, perl-format
|
||||
msgid "unknown sort type %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../IkiWiki/Plugin/inline.pm:171
|
||||
#: ../IkiWiki/Plugin/inline.pm:172
|
||||
msgid "Add a new post titled:"
|
||||
msgstr ""
|
||||
|
||||
#: ../IkiWiki/Plugin/inline.pm:186
|
||||
#: ../IkiWiki/Plugin/inline.pm:188
|
||||
#, perl-format
|
||||
msgid "nonexistant template %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../IkiWiki/Plugin/inline.pm:217 ../IkiWiki/Render.pm:103
|
||||
#: ../IkiWiki/Plugin/inline.pm:219 ../IkiWiki/Render.pm:103
|
||||
msgid "Discussion"
|
||||
msgstr ""
|
||||
|
||||
#: ../IkiWiki/Plugin/inline.pm:430
|
||||
#: ../IkiWiki/Plugin/inline.pm:433
|
||||
msgid "RPC::XML::Client not found, not pinging"
|
||||
msgstr ""
|
||||
|
||||
|
|
Loading…
Reference in New Issue