summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-05-26 01:10:58 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-05-26 01:10:58 +0000
commit5466a1daf99e8e4c67a19f871aaf558312569652 (patch)
treeaac6347ea7eb762fad92857ba69ef2c7a839dd74 /IkiWiki/Plugin
parent7f64dd4f6688149306282f1a2a951535b9493300 (diff)
* The page name and parent links has switched from using a <h1> to a styled
<span>, so pages can use <h1> internally instead of needing to use <h2>. * Updated all of ikiwiki's own wiki pages for that. * Add pagetemplate hook, which can be used by plugins that want to mess around with adding new stuff to the page template. * Remove headercontent; the search plugin now adds the search box to the header by registering a pagetemplate hook, and other plugins should do similarly.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/search.pm12
-rw-r--r--IkiWiki/Plugin/skeleton.pm9
2 files changed, 19 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index 213ed45ff..c94974ac4 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -9,6 +9,8 @@ use IkiWiki;
sub import { #{{{
IkiWiki::hook(type => "checkconfig", id => "hyperestraier",
call => \&checkconfig);
+ IkiWiki::hook(type => "pagetemplate", id => "hyperestraier",
+ call => \&pagetemplate);
IkiWiki::hook(type => "delete", id => "hyperestraier",
call => \&delete);
IkiWiki::hook(type => "change", id => "hyperestraier",
@@ -23,8 +25,14 @@ sub checkconfig () { #{{{
IkiWiki::error("Must specify $required when using the search plugin\n");
}
}
+} #}}}
+
+sub pagetemplate ($$) { #{{{
+ my $page=shift;
+ my $template=shift;
- $IkiWiki::config{headercontent}.=qq{
+ # Add search box to page header.
+ $template->param(searchform => qq{
<form method="get" action="$IkiWiki::config{cgiurl}" id="searchform">
<div>
<input type="text" name="phrase" value="" size="16" />
@@ -32,7 +40,7 @@ sub checkconfig () { #{{{
<input type="hidden" name="do" value="hyperestraier" />
</div>
</form>
-};
+});
} #}}}
sub delete (@) { #{{{
diff --git a/IkiWiki/Plugin/skeleton.pm b/IkiWiki/Plugin/skeleton.pm
index 346dfa5ff..226270c38 100644
--- a/IkiWiki/Plugin/skeleton.pm
+++ b/IkiWiki/Plugin/skeleton.pm
@@ -17,6 +17,8 @@ sub import { #{{{
call => \&filter);
IkiWiki::hook(type => "sanitize", id => "skeleton",
call => \&sanitize);
+ IkiWiki::hook(type => "pagetemplate", id => "skeleton",
+ call => \&pagetemplate);
IkiWiki::hook(type => "delete", id => "skeleton",
call => \&delete);
IkiWiki::hook(type => "change", id => "skeleton",
@@ -51,6 +53,13 @@ sub sanitize ($) { #{{{
return $content;
} # }}}
+sub pagetemplate ($$) { #{{{
+ my $page=shift;
+ my $template=shift;
+
+ IkiWiki::debug("skeleton plugin running as a pagetemplate hook");
+} # }}}
+
sub delete (@) { #{{{
my @files=@_;