From 4dcea6207d03fcdc25bc1c172d69c30673b7254a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 31 Mar 2010 17:51:46 -0400 Subject: page.tmpl: Add Cache-Control must-revalidate to ensure that users (especially of Firefox) see fresh page content. Since Firefox version 3, it's done aggressive caching of visited pages, and does not, by default, check if the cached content is still valid when reloading or revisiting a page. By default, Firefox seems to not re-contact the web server at all. Compare with eg, Epiphany and Chromium, which appear to always check, and get back a 304 when the page is unchanged. This header makes Firefox do the right thing, at least for html files. It still over-caches if css, javascript, images, etc, are changed. --- templates/page.tmpl | 1 + 1 file changed, 1 insertion(+) (limited to 'templates/page.tmpl') diff --git a/templates/page.tmpl b/templates/page.tmpl index 968066a19..c24f88823 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -3,6 +3,7 @@ + <TMPL_VAR TITLE> -- cgit v1.2.3 From baaa848f6c06b0b3a59677d3551e130c65e5fde7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 15:04:17 -0400 Subject: CSS and templates for sidebar changed to use a class, not an id. Multiple sidebars should be possible; also, I want to add a sidebar template. --- debian/changelog | 3 ++- doc/examples/blog.mdwn | 2 +- doc/examples/blog/index.mdwn | 1 - doc/examples/blog/sidebar.mdwn | 7 ------- doc/style.css | 2 +- templates/page.tmpl | 2 +- 6 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 doc/examples/blog/sidebar.mdwn (limited to 'templates/page.tmpl') diff --git a/debian/changelog b/debian/changelog index c2b0c3c23..03361e6a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100410) UNRELEASED; urgency=low +ikiwiki (3.20100415) UNRELEASED; urgency=low [ Joey Hess ] * bzr: Fix bzr log parsing to work with bzr 2.0. (liw) @@ -36,6 +36,7 @@ ikiwiki (3.20100410) UNRELEASED; urgency=low * pagestats: Use style=list to get a list of tags, scaled by use like in a tag cloud. This is useful to put in a sidebar. * Rework example blog front page. + * CSS and templates for sidebar changed to use a class, not an id. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/examples/blog.mdwn b/doc/examples/blog.mdwn index b9b57b944..33637e57d 100644 --- a/doc/examples/blog.mdwn +++ b/doc/examples/blog.mdwn @@ -14,7 +14,7 @@ Some additional configuration you might want to do: \[[!tag tags/life]] * Enable the [[sidebar|plugins/sidebar]] plugin to get a sidebar listing all - the categories you've tagged posts with. + the categories you've tagged posts with, and other navigation links. * Enable the [[pagestats|plugins/pagestats]] plugin to get a tag cloud to display on the [[index]]. diff --git a/doc/examples/blog/index.mdwn b/doc/examples/blog/index.mdwn index b273ba1a9..da95e7660 100644 --- a/doc/examples/blog/index.mdwn +++ b/doc/examples/blog/index.mdwn @@ -4,7 +4,6 @@ * [[Recent_Comments|comments]] * [[Archives]] -[[!if test="enabled(calendar)" then=""" [[!calendar pages="./posts/* and !*/Discussion"]] """]] diff --git a/doc/examples/blog/sidebar.mdwn b/doc/examples/blog/sidebar.mdwn deleted file mode 100644 index a9fac388e..000000000 --- a/doc/examples/blog/sidebar.mdwn +++ /dev/null @@ -1,7 +0,0 @@ -Example sidebar - -* [[Blog|index]] -* [[Archive|posts]] - -Categories: -[[!map pages="./tags/* and !*/Discussion"]] diff --git a/doc/style.css b/doc/style.css index 317d4c7aa..af0fc230c 100644 --- a/doc/style.css +++ b/doc/style.css @@ -228,7 +228,7 @@ div.recentchanges { .bigPC { font-size: 115%; } .biggestPC { font-size: 130%; } -#sidebar { +.sidebar { line-height: 3ex; width: 20ex; float: right; diff --git a/templates/page.tmpl b/templates/page.tmpl index c24f88823..7e850a56b 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -92,7 +92,7 @@ - - + -- cgit v1.2.3 From 0aad1794ad27da6ab41001e335eba952c2e0ac88 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 May 2010 15:41:12 -0400 Subject: improve semantic markup Now the toplevel layout is:
content
comments
And I managed to preserve all CSS ids and names in their prior structure, so CSS should not need changed. --- templates/page.tmpl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'templates/page.tmpl') diff --git a/templates/page.tmpl b/templates/page.tmpl index 0176b0116..195ce7886 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -26,7 +26,9 @@ - + -- cgit v1.2.3 From 2f22ee85e547dfe408fc0ec520aed6a6e137e136 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 3 May 2010 12:15:40 -0400 Subject: Add ACTIONS variable to page.tmpl, which allows plugins to add arbitrary links to the action bar without modifying the template further. (COMMENTSLINK and DISCUSSIONLINK could be folded into this, but are kept separate for now to avoid breaking modified templates.) --- IkiWiki/Plugin/skeleton.pm.example | 9 +++++++++ IkiWiki/Render.pm | 9 ++++++++- debian/changelog | 4 ++++ doc/plugins/write.mdwn | 9 +++++++++ templates/page.tmpl | 9 +++++++-- 5 files changed, 37 insertions(+), 3 deletions(-) (limited to 'templates/page.tmpl') diff --git a/IkiWiki/Plugin/skeleton.pm.example b/IkiWiki/Plugin/skeleton.pm.example index ddf2996d6..a404e24af 100644 --- a/IkiWiki/Plugin/skeleton.pm.example +++ b/IkiWiki/Plugin/skeleton.pm.example @@ -24,6 +24,7 @@ sub import { hook(type => "format", id => "skeleton", call => \&format); hook(type => "pagetemplate", id => "skeleton", call => \&pagetemplate); hook(type => "templatefile", id => "skeleton", call => \&templatefile); + hook(type => "pageactions", id => "skeleton", call => \&pageactions); hook(type => "delete", id => "skeleton", call => \&delete); hook(type => "change", id => "skeleton", call => \&change); hook(type => "cgi", id => "skeleton", call => \&cgi); @@ -146,6 +147,14 @@ sub templatefile (@) { debug("skeleton plugin running as a templatefile hook"); } +sub pageactions (@) { + my %params=@_; + my $page=$params{page}; + + debug("skeleton plugin running as a pageactions hook"); + return (); +} + sub delete (@) { my @files=@_; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index cf6943e7d..a824ba539 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -112,7 +112,14 @@ sub genpage ($$) { } } - if ($actions) { + my @actions; + run_hooks(pageactions => sub { + push @actions, map { { action => $_ } } + grep { defined } shift->(page => $page); + }); + $template->param(actions => \@actions); + + if ($actions || @actions) { $template->param(have_actions => 1); } diff --git a/debian/changelog b/debian/changelog index 789fda1ce..e03375bd3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,10 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low * In html5 mode, use all the nice new semantic tags. Care was taken to not change the id/class named used in the CSS, so only CSS that refers to tag types needed to be changed. + * Add ACTIONS variable to page.tmpl, which allows plugins to add arbitrary + links to the action bar without modifying the template further. + (COMMENTSLINK and DISCUSSIONLINK could be folded into this, but + are kept separate for now to avoid breaking modified templates.) -- Joey Hess Sun, 02 May 2010 13:22:50 -0400 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 5e7042c3b..3b1d770eb 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -319,6 +319,15 @@ should return the name of the template file to use (relative to the template directory), or undef if it doesn't want to change the default ("page.tmpl"). +### pageactions + + hook(type => "pageactions", id => "foo", call => \&pageactions); + +This hook allows plugins to add arbitrary actions to the action bar on a +page (next to Edit, RecentChanges, etc). The hook is passed a "page" +parameter, and can return a list of html fragments to add to the action +bar. + ### sanitize hook(type => "sanitize", id => "foo", call => \&sanitize); diff --git a/templates/page.tmpl b/templates/page.tmpl index 195ce7886..8a9911fae 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -66,11 +66,16 @@
  • Preferences
  • + + +
  • +
    +
    -

  • +
  • -

  • +
  • -- cgit v1.2.3 From 2a2976f7ff281687b5e69a3963fc9c9fe03ef859 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 18:18:50 -0400 Subject: add the setting as in misc.tmpl; only ever do it if not ispage Also, add FOOTER, to allow disabling the footer. --- templates/misc.tmpl | 43 ------------------------------------------- templates/page.tmpl | 11 +++++++++++ 2 files changed, 11 insertions(+), 43 deletions(-) delete mode 100644 templates/misc.tmpl (limited to 'templates/page.tmpl') diff --git a/templates/misc.tmpl b/templates/misc.tmpl deleted file mode 100644 index 5654cab61..000000000 --- a/templates/misc.tmpl +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - -<TMPL_VAR TITLE> - - - - - - - - - - -
    - -
    - -
    - - - diff --git a/templates/page.tmpl b/templates/page.tmpl index 8a9911fae..b6c751a3a 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -5,6 +5,15 @@
    + + + + + + + + + <TMPL_VAR TITLE> @@ -124,6 +133,7 @@ +
    +
    -- cgit v1.2.3 From 58a07f9e5436ec815c0cb5736a9680096c977eed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 18:27:09 -0400 Subject: on second thought, remove FOOTER variable We always want a footer, just not a pagefooter when doing misctemplate. --- templates/page.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates/page.tmpl') diff --git a/templates/page.tmpl b/templates/page.tmpl index b6c751a3a..f5257058c 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -133,8 +133,8 @@ -
    +
    -
    -- cgit v1.2.3 From 5971a731e98b9b6543d78572c181ffc1bb7e1dd1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 18:42:18 -0400 Subject: allow search form visibility to be controlled on the template hide extrafooter from misctemplate display per default --- IkiWiki.pm | 1 - templates/page.tmpl | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'templates/page.tmpl') diff --git a/IkiWiki.pm b/IkiWiki.pm index d20a3709c..54271becc 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1757,7 +1757,6 @@ sub misctemplate ($$;@) { baseurl => baseurl(), html5 => $config{html5}, have_actions => 0, # force off - searchform => 0, # ditto parentlinks => [{ # override url => $config{url}, page => $config{wikiname}, diff --git a/templates/page.tmpl b/templates/page.tmpl index f5257058c..eb76cafa6 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -52,9 +52,11 @@ + + @@ -184,8 +186,8 @@ Last edited - + -- cgit v1.2.3 From f52f395437a946478da2a126015c05e3e0afdc1f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 21:08:41 -0400 Subject: consistently drop NAME= in templates also add template syntax smoke test --- doc/ikiwiki/directive/template.mdwn | 8 ++--- doc/templates.mdwn | 4 +-- doc/templates/gitbranch.mdwn | 2 +- doc/templates/note.mdwn | 2 +- doc/templates/plugin.mdwn | 2 +- doc/templates/popup.mdwn | 2 +- templates/aggregatepost.tmpl | 18 +++++------ templates/archivepage.tmpl | 6 ++-- templates/atomitem.tmpl | 24 +++++++------- templates/atompage.tmpl | 10 +++--- templates/blogpost.tmpl | 8 ++--- templates/change.tmpl | 18 +++++------ templates/comment.tmpl | 30 ++++++++--------- templates/commentmoderation.tmpl | 4 +-- templates/editcomment.tmpl | 12 +++---- templates/editpage.tmpl | 12 +++---- templates/feedlink.tmpl | 8 ++--- templates/googleform.tmpl | 1 + templates/inlinepage.tmpl | 18 +++++------ templates/microblog.tmpl | 4 +-- templates/page.tmpl | 64 ++++++++++++++++++------------------- templates/pocreatepage.tmpl | 4 +-- templates/renamesummary.tmpl | 4 +-- templates/rssitem.tmpl | 14 ++++---- templates/titlepage.tmpl | 2 +- 25 files changed, 141 insertions(+), 140 deletions(-) (limited to 'templates/page.tmpl') diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index 052ca7873..6c50fa32e 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -53,21 +53,21 @@ few things: * To insert the raw value of a variable, with wiki markup not yet converted to html, use ``. * To make a block of text conditional on a variable being set use - `text`. + `text`. * To use one block of text if a variable is set and a second if it's not, - use `textother text` + use `textother text` Here's a sample template: Name: \[[]]
    Age:
    - + Favorite color:
    No favorite color.
    - +
    diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 2444cf14d..8f6561fcf 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -12,9 +12,9 @@ easy to learn. All you really need to know to modify templates is this: * To insert the value of a template variable, use ``. * To make a block of text conditional on a variable being set use - `text`. + `text`. * To use one block of text if a variable is set and a second if it's not, - use `textother text` + use `textother text` [[!if test="enabled(template)" then=""" ## template pages diff --git a/doc/templates/gitbranch.mdwn b/doc/templates/gitbranch.mdwn index fcce925d9..962420940 100644 --- a/doc/templates/gitbranch.mdwn +++ b/doc/templates/gitbranch.mdwn @@ -3,7 +3,7 @@ Available in a [[!taglink /git]] repository.
    Branch:
    Author:
    - + This template is used to create an infobox for a git branch. It uses these parameters: diff --git a/doc/templates/note.mdwn b/doc/templates/note.mdwn index 4cc323c0e..9ef5ad942 100644 --- a/doc/templates/note.mdwn +++ b/doc/templates/note.mdwn @@ -1,7 +1,7 @@
    - + Use this template to insert a note into a page. The note will be styled to float to the right of other text on the page. This template has one parameter: diff --git a/doc/templates/plugin.mdwn b/doc/templates/plugin.mdwn index c1d1974d6..322c49445 100644 --- a/doc/templates/plugin.mdwn +++ b/doc/templates/plugin.mdwn @@ -8,7 +8,7 @@ Currently enabled: [[!if test="enabled()" then="yes" else="no"]]< [[!if test="sourcepage(plugins/contrib/*)" then="""[[!meta title=" (third party plugin)"]]"""]] [[!tag plugins/type/core]] - + This template is used to create an infobox for an ikiwiki plugin. It uses these parameters:
      diff --git a/doc/templates/popup.mdwn b/doc/templates/popup.mdwn index b355daa2e..92455eb21 100644 --- a/doc/templates/popup.mdwn +++ b/doc/templates/popup.mdwn @@ -1,4 +1,4 @@ - + Use this template to create a popup window that is displayed when the mouse is over part of the page. This template has two parameters:
        diff --git a/templates/aggregatepost.tmpl b/templates/aggregatepost.tmpl index 8b8936733..4e89efe32 100644 --- a/templates/aggregatepost.tmpl +++ b/templates/aggregatepost.tmpl @@ -1,15 +1,15 @@ - + [[!tag ]] - -[[!meta title=""]] + +[[!meta title=""]] - -[[!meta permalink=""]] + +[[!meta permalink=""]] - -[[!meta copyright=""]] + +[[!meta copyright=""]] -[[!meta author=""]] -[[!meta authorurl=""]] +[[!meta author=""]] +[[!meta authorurl=""]] diff --git a/templates/archivepage.tmpl b/templates/archivepage.tmpl index 28800e763..93bdd9ce0 100644 --- a/templates/archivepage.tmpl +++ b/templates/archivepage.tmpl @@ -1,14 +1,14 @@

        - +

        Posted - + by - + diff --git a/templates/atomitem.tmpl b/templates/atomitem.tmpl index 87cbee9e0..4ed17bc62 100644 --- a/templates/atomitem.tmpl +++ b/templates/atomitem.tmpl @@ -1,17 +1,17 @@ <TMPL_VAR TITLE> - + - + - + - + @@ -19,30 +19,30 @@ - + - - + + - + - - " type="text/html" /> + + - - " type="application/atom+xml" /> + + diff --git a/templates/atompage.tmpl b/templates/atompage.tmpl index fc0088ae8..e82b59827 100644 --- a/templates/atompage.tmpl +++ b/templates/atompage.tmpl @@ -5,15 +5,15 @@ - + - + - + @@ -21,13 +21,13 @@ - + - + diff --git a/templates/blogpost.tmpl b/templates/blogpost.tmpl index 7eeede603..5a31e3f8a 100644 --- a/templates/blogpost.tmpl +++ b/templates/blogpost.tmpl @@ -1,10 +1,10 @@

        - -RSS + +RSS - -Atom + +Atom diff --git a/templates/change.tmpl b/templates/change.tmpl index 5f277a0fb..671b9e483 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -2,15 +2,15 @@ [[!meta authorurl=""""""]] -[[!meta title="""change to on """]] +[[!meta title="""change to on """]] [[!meta permalink=""]]
        - - -
        + + +
        - +
        -
        +
         
        diff --git a/templates/comment.tmpl b/templates/comment.tmpl index 39cba0ff9..fa90e6d26 100644 --- a/templates/comment.tmpl +++ b/templates/comment.tmpl @@ -1,5 +1,5 @@ -
        -
        +
        +
        @@ -15,40 +15,40 @@
        Comment by - - + + - + - - + + - + - - + + - - + + - +
        - +
        @@ -183,7 +183,7 @@ Last edited
        - +
        -- cgit v1.2.3 From 5a4c95cc352d6895c11542245981c62a5c003370 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:04:02 -0400 Subject: enable action bar on misctemplates So RecentChanges shows on the action bar there, convert recentchanges to use new pageactions hook, with compatability code to avoid breaking old templates. --- IkiWiki.pm | 11 ++++++++++- IkiWiki/Plugin/recentchanges.pm | 18 ++++++++++++++++-- templates/page.tmpl | 3 --- 3 files changed, 26 insertions(+), 6 deletions(-) (limited to 'templates/page.tmpl') diff --git a/IkiWiki.pm b/IkiWiki.pm index 33e4e1d1f..46c29abe3 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1748,7 +1748,6 @@ sub misctemplate ($$;@) { $template->param( dynamic => 1, - have_actions => 0, # force off title => $title, wikiname => $config{wikiname}, content => $content, @@ -1756,6 +1755,16 @@ sub misctemplate ($$;@) { html5 => $config{html5}, @_, ); + + my @actions; + run_hooks(pageactions => sub { + push @actions, map { { action => $_ } } + grep { defined } shift->(page => ""); + }); + $template->param(actions => \@actions); + if (@actions) { + $template->param(have_actions => 1); + } return $template->output; } diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 5c7b71aaa..65044080f 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -11,6 +11,7 @@ sub import { hook(type => "getsetup", id => "recentchanges", call => \&getsetup); hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig); hook(type => "refresh", id => "recentchanges", call => \&refresh); + hook(type => "pageactions", id => "recentchanges", call => \&pageactions); hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate); hook(type => "htmlize", id => "_change", call => \&htmlize); # Load goto to fix up links from recentchanges @@ -61,14 +62,27 @@ sub refresh ($) { } # Enable the recentchanges link on wiki pages. +sub pageactions (@) { + my %params=@_; + my $page=$params{page}; + + if (defined $config{recentchangespage} && $config{rcs} && + $page ne $config{recentchangespage}) { + return htmllink($page, $page, $config{recentchangespage}, + gettext("RecentChanges")); + } +} + +# Backwards compatability for templates still using +# RECENTCHANGESURL. sub pagetemplate (@) { my %params=@_; my $template=$params{template}; my $page=$params{page}; if (defined $config{recentchangespage} && $config{rcs} && - $page ne $config{recentchangespage} && - $template->query(name => "recentchangesurl")) { + $template->query(name => "recentchangesurl") && + $page ne $config{recentchangespage}) { $template->param(recentchangesurl => urlto($config{recentchangespage}, $page)); $template->param(have_actions => 1); } diff --git a/templates/page.tmpl b/templates/page.tmpl index 3bb7197f0..049d31ad5 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -61,9 +61,6 @@
      • Edit
      • - -
      • RecentChanges
      • -
      • History
      • -- cgit v1.2.3 From 3dd98a3b3f66555ca3d83ec6940a9cd11cf8bec7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:38:08 -0400 Subject: put back recentchangesurl On second thought, misctemplate can use pagetemplate hooks to provide it, so it's better to keep back-compat, and allow full customisation of how it's displayed via the template. --- IkiWiki/Plugin/recentchanges.pm | 17 +---------------- templates/page.tmpl | 3 +++ 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'templates/page.tmpl') diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 0ee8f0e66..e546e4702 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -11,8 +11,6 @@ sub import { hook(type => "getsetup", id => "recentchanges", call => \&getsetup); hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig); hook(type => "refresh", id => "recentchanges", call => \&refresh); - hook(type => "pageactions", id => "recentchanges", call => \&pageactions, - first => 1); hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate); hook(type => "htmlize", id => "_change", call => \&htmlize); # Load goto to fix up links from recentchanges @@ -62,20 +60,7 @@ sub refresh ($) { } } -# Enable the recentchanges link on wiki pages. -sub pageactions (@) { - my %params=@_; - my $page=$params{page}; - - if (defined $config{recentchangespage} && $config{rcs} && - $page ne $config{recentchangespage}) { - return htmllink($page, $page, $config{recentchangespage}, - linktext => gettext("RecentChanges")); - } -} - -# Backwards compatability for templates still using -# RECENTCHANGESURL. +# Enable the recentchanges link. sub pagetemplate (@) { my %params=@_; my $template=$params{template}; diff --git a/templates/page.tmpl b/templates/page.tmpl index 049d31ad5..3bb7197f0 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -61,6 +61,9 @@
      • Edit
      • + +
      • RecentChanges
      • +
      • History
      • -- cgit v1.2.3 From 827e092b58771e5c5efdbc1cf04a62a1d039a015 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:40:42 -0400 Subject: show search form on dynamic pages --- templates/page.tmpl | 2 -- 1 file changed, 2 deletions(-) (limited to 'templates/page.tmpl') diff --git a/templates/page.tmpl b/templates/page.tmpl index 3bb7197f0..f7944e40e 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -48,11 +48,9 @@ - - -- cgit v1.2.3 From 4c6fa6413fc26ddbb1f8dc2c73f97a105c5002f8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 21:42:48 -0400 Subject: avoid showing redundant search box on search results page --- IkiWiki/Plugin/search.pm | 3 ++- templates/page.tmpl | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'templates/page.tmpl') diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index cc26b7ac1..a9089620b 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -228,7 +228,8 @@ sub setupfiles () { # Avoid omega interpreting anything in the misctemplate # as an omegascript command. - my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0"); + my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0", + searching => 1); eval q{use HTML::Entities}; error $@ if $@; $misctemplate=encode_entities($misctemplate, '\$'); diff --git a/templates/page.tmpl b/templates/page.tmpl index f7944e40e..a7d200466 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -48,9 +48,11 @@ + + -- cgit v1.2.3 From c8b34aa31c7d146adf4210c6171dfea2988a7688 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 21:45:22 -0400 Subject: allow misctemplate callers to pass params to suppress actions etc Suppress disiplay of small search for on search results page, and of Prefrences link on prefs page. --- IkiWiki.pm | 3 +-- IkiWiki/CGI.pm | 4 +++- IkiWiki/Plugin/search.pm | 3 ++- templates/page.tmpl | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'templates/page.tmpl') diff --git a/IkiWiki.pm b/IkiWiki.pm index a42f56bf0..699ad13da 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1745,6 +1745,7 @@ sub misctemplate ($$;@) { run_hooks(pagetemplate => sub { shift->(page => "", destpage => "", template => $template); }); + templateactions($template, ""); $template->param( dynamic => 1, @@ -1755,8 +1756,6 @@ sub misctemplate ($$;@) { html5 => $config{html5}, @_, ); - - templateactions($template, ""); return $template->output; } diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index b98e9e0a1..28020b500 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -247,7 +247,9 @@ sub cgi_prefs ($$) { $form->text(gettext("Preferences saved.")); } - showform($form, $buttons, $session, $q); + showform($form, $buttons, $session, $q, + prefsurl => "", # avoid showing the preferences link + ); } sub cgi_custom_failure ($$$) { diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index a9089620b..ff5d0ccbe 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -229,7 +229,8 @@ sub setupfiles () { # Avoid omega interpreting anything in the misctemplate # as an omegascript command. my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0", - searching => 1); + searchform => "", # avoid showing the small search form + ); eval q{use HTML::Entities}; error $@ if $@; $misctemplate=encode_entities($misctemplate, '\$'); diff --git a/templates/page.tmpl b/templates/page.tmpl index a7d200466..f7944e40e 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -48,11 +48,9 @@ - - -- cgit v1.2.3 From ffcd2da8274b44663207bb866007ee3bc8d8a15f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 16 May 2010 00:03:35 -0400 Subject: page.tmpl: Accidentially broke po plugin's otherlanguages list styling when modifying for html5; now fixed. --- debian/changelog | 7 +++++++ templates/page.tmpl | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'templates/page.tmpl') diff --git a/debian/changelog b/debian/changelog index 50b1fddff..918970a3c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20100516) UNRELEASED; urgency=low + + * page.tmpl: Accidentially broke po plugin's otherlanguages list styling + when modifying for html5; now fixed. + + -- Joey Hess Sun, 16 May 2010 00:03:06 -0400 + ikiwiki (3.20100515) unstable; urgency=low * Removed misc.tmpl. Now to theme ikiwiki, you only need to customise diff --git a/templates/page.tmpl b/templates/page.tmpl index f7944e40e..235b693fe 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -88,7 +88,7 @@ -