]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* inline: add feedonly option, set feedonly=yes to get only the feed button
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 13 Sep 2007 22:23:32 +0000 (22:23 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 13 Sep 2007 22:23:32 +0000 (22:23 +0000)
  but not inline the pages.

IkiWiki/Plugin/inline.pm
debian/changelog
doc/blog.mdwn
po/ikiwiki.pot

index 30b09d1ad260088d540011f10924b5cf4e3a9832..0b3d5e40614040620f8d380df2809c57434d298a 100644 (file)
@@ -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)))));
+                               }
                        }
                }
        }
index 3d4005416436598918ba988de8360ec54fcd4a15..749055e730d625b531d70199d06b6acb78a7e9a8 100644 (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
 
index 1593278d1aa3aa77af322b58c703a41aaa9c5221..2792a35b14ebf88356d9a6c3796757bf85ab18b1 100644 (file)
@@ -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.
index ebc61d48c65a8c13e955171d37df2eff27440433..381009ae21d71e9a17e2899a70fda7676085d201 100644 (file)
@@ -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 ""