summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ikiwiki.setup7
-rw-r--r--perl/IkiWiki/Plugin/farbar.pm53
-rw-r--r--perl/IkiWiki/Plugin/topbar.pm53
m---------templates0
4 files changed, 113 insertions, 0 deletions
diff --git a/ikiwiki.setup b/ikiwiki.setup
index 5721896..2bbc98a 100644
--- a/ikiwiki.setup
+++ b/ikiwiki.setup
@@ -256,4 +256,11 @@ use IkiWiki::Setup::Standard {
#websetup_force_plugins => [],
# show unsafe settings, read-only, in web interface?
#websetup_show_unsafe => 1,
+
+ # varioki plugin (strings are eval'ed: double-quote actual strings!)
+ #varioki => {
+ # 'branding_logo_text' => '"Example Website"',
+ # 'branding_logo' => '"logo.png"',
+ # 'branding_logo_tagline' => '"Yet another ikiwiki site!"',
+ #},
}
diff --git a/perl/IkiWiki/Plugin/farbar.pm b/perl/IkiWiki/Plugin/farbar.pm
new file mode 100644
index 0000000..ab4390a
--- /dev/null
+++ b/perl/IkiWiki/Plugin/farbar.pm
@@ -0,0 +1,53 @@
+#!/usr/bin/perl
+# Farbar plugin.
+# by Jonas Smedegaard <dr@jones.dk>
+# Heavily based on Sidebar by Tuomo Valkonen <tuomov at iki dot fi>
+
+package IkiWiki::Plugin::farbar;
+
+use warnings;
+use strict;
+use IkiWiki 2.00;
+
+sub import { #{{{
+ hook(type => "pagetemplate", id => "farbar", call => \&pagetemplate);
+} # }}}
+
+sub farbar_content ($) { #{{{
+ my $page=shift;
+
+ my $farbar_page=bestlink($page, "farbar") || return;
+ my $farbar_file=$pagesources{$farbar_page} || return;
+ my $farbar_type=pagetype($farbar_file);
+
+ if (defined $farbar_type) {
+ # FIXME: This isn't quite right; it won't take into account
+ # adding a new farbar page. So adding such a page
+ # currently requires a wiki rebuild.
+ add_depends($page, $farbar_page);
+
+ my $content=readfile(srcfile($farbar_file));
+ return unless length $content;
+ return IkiWiki::htmlize($farbar_page, $page, $farbar_type,
+ IkiWiki::linkify($farbar_page, $page,
+ IkiWiki::preprocess($farbar_page, $page,
+ IkiWiki::filter($farbar_page, $page, $content))));
+ }
+
+} # }}}
+
+sub pagetemplate (@) { #{{{
+ my %params=@_;
+
+ my $page=$params{page};
+ my $template=$params{template};
+
+ if ($template->query(name => "farbar")) {
+ my $content=farbar_content($page);
+ if (defined $content && length $content) {
+ $template->param(farbar => $content);
+ }
+ }
+} # }}}
+
+1
diff --git a/perl/IkiWiki/Plugin/topbar.pm b/perl/IkiWiki/Plugin/topbar.pm
new file mode 100644
index 0000000..aa62a11
--- /dev/null
+++ b/perl/IkiWiki/Plugin/topbar.pm
@@ -0,0 +1,53 @@
+#!/usr/bin/perl
+# Topbar plugin.
+# by Jonas Smedegaard <dr@jones.dk>
+# Heavily based on Sidebar by Tuomo Valkonen <tuomov at iki dot fi>
+
+package IkiWiki::Plugin::topbar;
+
+use warnings;
+use strict;
+use IkiWiki 2.00;
+
+sub import { #{{{
+ hook(type => "pagetemplate", id => "topbar", call => \&pagetemplate);
+} # }}}
+
+sub topbar_content ($) { #{{{
+ my $page=shift;
+
+ my $topbar_page=bestlink($page, "topbar") || return;
+ my $topbar_file=$pagesources{$topbar_page} || return;
+ my $topbar_type=pagetype($topbar_file);
+
+ if (defined $topbar_type) {
+ # FIXME: This isn't quite right; it won't take into account
+ # adding a new topbar page. So adding such a page
+ # currently requires a wiki rebuild.
+ add_depends($page, $topbar_page);
+
+ my $content=readfile(srcfile($topbar_file));
+ return unless length $content;
+ return IkiWiki::htmlize($topbar_page, $page, $topbar_type,
+ IkiWiki::linkify($topbar_page, $page,
+ IkiWiki::preprocess($topbar_page, $page,
+ IkiWiki::filter($topbar_page, $page, $content))));
+ }
+
+} # }}}
+
+sub pagetemplate (@) { #{{{
+ my %params=@_;
+
+ my $page=$params{page};
+ my $template=$params{template};
+
+ if ($template->query(name => "topbar")) {
+ my $content=topbar_content($page);
+ if (defined $content && length $content) {
+ $template->param(topbar => $content);
+ }
+ }
+} # }}}
+
+1
diff --git a/templates b/templates
-Subproject 5df058b2b3dc6e565ad3b3604263f487ef65f2a
+Subproject c8ca2dc2038ec115299bc2f8a78e525d0b19cbe