From: Joey Hess Date: Wed, 5 May 2010 22:22:47 +0000 (-0400) Subject: no more misc.tmpl X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/66cc23a591f25344072deb07b2ccc7a4d4c89047 no more misc.tmpl * Removed misc.tmpl. Now to theme ikiwiki, you only need to customise a single template, page.tmpl. * misc.tmpl will, however, still be read if a locally modified version exists. This is to avoid forcing users to update page.tmpl right now. --- diff --git a/IkiWiki.pm b/IkiWiki.pm index c428de77f..d20a3709c 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1742,21 +1742,29 @@ sub template ($;@) { sub misctemplate ($$;@) { my $title=shift; - my $pagebody=shift; + my $content=shift; - my $template=template("misc.tmpl"); + my $template=template("misc.tmpl") || template("page.tmpl"); + + run_hooks(pagetemplate => sub { + shift->(page => "", destpage => "", template => $template); + }); + $template->param( title => $title, - indexlink => indexlink(), wikiname => $config{wikiname}, - pagebody => $pagebody, + content => $content, baseurl => baseurl(), html5 => $config{html5}, + have_actions => 0, # force off + searchform => 0, # ditto + parentlinks => [{ # override + url => $config{url}, + page => $config{wikiname}, + }], @_, ); - run_hooks(pagetemplate => sub { - shift->(page => "", destpage => "", template => $template); - }); + return $template->output; } diff --git a/debian/changelog b/debian/changelog index 43c907544..0c3a99f0e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +ikiwiki (3.20100505) UNRELEASED; urgency=low + + * Removed misc.tmpl. Now to theme ikiwiki, you only need to customise + a single template, page.tmpl. + * misc.tmpl will, however, still be read if a locally modified version + exists. This is to avoid forcing users to update page.tmpl right now. + + -- Joey Hess Wed, 05 May 2010 18:07:29 -0400 + ikiwiki (3.20100504) unstable; urgency=low * Add parameter to displaytime to specify that it is a pubdate, diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index e257c21a2..729d22fb8 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -81,6 +81,9 @@ Probably incomplete list: * Enable tagbase by default (so that tag autocreation will work by default). Note that this is already done for wikis created by `auto-blog.setup`. * [[tips/html5]] on by default (some day..) +* stop reading misc.tmpl if it exists (only done in case users have a customized + version, or an outdated version of page.tmpl that cannot be used by + misctemplate) In general, we try to use [[ikiwiki-transition]] or forced rebuilds on upgrade to deal with changes that break compatability. Some things that diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 9208db0eb..2444cf14d 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -45,8 +45,6 @@ html out of ikiwiki and in the templates. key template to customize. [[!if test="enabled(pagetemplate)" then=""" (The pagetemplate directive can be used to make a page use a different template than `page.tmpl`.)"""]] -* `misc.tmpl` - Generic template used for any page that doesn't - have a custom template. * `rsspage.tmpl` - Used for generating rss feeds for blogs. * `rssitem.tmpl` - Used for generating individual items on rss feeds. * `atompage.tmpl` - Used for generating atom feeds for blogs.