ikiwiki is fast and smart about updating a wiki, it only builds pages that have changed (and tracks things like creation of new pages and links that can indirectly cause a page to need a rebuild)
+* [[Templates]]
+
+ ikiwiki generates html using templates so you can change the look and
+ layout of all pages in any way you would like.
+
* [[BackLinks]]
Automatically included on pages. Rather faster than eg [[MoinMoin]] and always there to help with navigation.
----
-It also has lots of [[TODO]] items and [[Bugs]]. This wiki is not ready for production!
\ No newline at end of file
+It also has lots of [[TODO]] items and [[Bugs]]. This wiki is not ready for production!
apt-get install ikiwiki # soon
- Ikiwiki requires [[MarkDown]] be installed, and also uses the following perl modules: `CGI::Session` `CGI::FormBuilder`
+ Ikiwiki requires [[MarkDown]] be installed, and also uses the following
+ perl modules: `CGI::Session` `CGI::FormBuilder` `HTML::Template`
2. Create the subversion repository for your wiki.
--historyurl='http://svn.host/trunk/doc/[[]]?root=wiki'
-11. Enjoy your new wiki!
\ No newline at end of file
+11. Enjoy your new wiki!
return @links;
} #}}}
-sub parentlinks ($) {
+sub parentlinks ($) { #{{{
my $page=shift;
my @ret;
$path.="../";
}
return @ret;
-}
+} #}}}
sub indexlink () { #{{{
return "<a href=\"$url\">$wikiname</a>/ ";
$when=concise(ago(time - str2time($3)));
}
elsif ($state eq 'header' && /^\s+[A-Z]\s+\Q$svn_base\E\/(.+)$/) {
- push @pages, pagename($1) if length $1;
+ push @pages, htmllink("", pagename($1), 1)
+ if length $1;
}
elsif ($state eq 'header' && /^$/) {
$state='body';
error("$this doesn't seem to be executable");
}
- my @params=($srcdir, $destdir, "--wikiname=$wikiname");
+ my @params=($srcdir, $templatedir, $destdir, "--wikiname=$wikiname");
push @params, "--verbose" if $verbose;
push @params, "--rebuild" if $rebuild;
push @params, "--nosvn" if !$svn;
exit 0;
} #}}}
-sub cgi_recentchanges ($) { #{{{
+sub cgi_recentchanges () { #{{{
my $q=shift;
-
-
- my $list="<ul>\n";
- foreach my $change (rcs_recentchanges(100)) {
- $list.="<li>";
- $list.=join(", ", map { htmllink("", $_, 1) } @{$change->{pages}});
- $list.="<br>\n";
- $list.="changed ".$change->{when}." by ".
- htmllink("", $change->{user}, 1).
- ": <i>".$change->{message}."</i>\n";
- $list.="</li>\n";
- }
- $list.="</ul>\n";
-
- print $q->header,
- $q->start_html("RecentChanges"),
- $q->h1(indexlink()." RecentChanges"),
- $list,
- $q->end_form,
- $q->end_html;
+ my $template=HTML::Template->new(
+ filename => "$templatedir/recentchanges.tmpl");
+ $template->param(
+ title => "RecentChanges",
+ indexlink => $url,
+ wikiname => $wikiname,
+ changelog => [rcs_recentchanges(100)],
+ );
+ return $template->output;
} #}}}
sub cgi_signin ($$) { #{{{
}
if ($do eq 'recentchanges') {
- cgi_recentchanges($q);
+ cgi_recentchanges();
return;
}
--- /dev/null
+<html>
+<head><title><TMPL_VAR TITLE></title></head>
+<body>
+
+<h1>
+<a href="<TMPL_VAR INDEXLINK>"><TMPL_VAR WIKINAME></a>/ <TMPL_VAR TITLE>
+</h1>
+
+<hr>
+
+<ul>
+<TMPL_LOOP NAME="CHANGELOG">
+ <li>
+ <TMPL_LOOP NAME="PAGES">
+ <TMPL_VAR NAME="LINK"></a>
+ </TMPL_LOOP>
+ <br>
+ changed <TMPL_LOOP NAME="WHEN"> by <TMPL_LOOP NAME="USER">:
+ <i><TMPL_LOOP NAME="MESSAGE"></i>
+ </li>
+</TMPL_LOOP>
+</ul>
+
+</body>
+</html>