<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
# favicon plugin.

package IkiWiki::Plugin::favicon;

use warnings;
use strict;
use IkiWiki 3.00;

sub import {
	hook(type =&gt; "getsetup", id =&gt; "favicon", call =&gt; \&amp;getsetup);
	hook(type =&gt; "pagetemplate", id =&gt; "favicon", call =&gt; \&amp;pagetemplate);
}

sub getsetup () {
	return
		plugin =&gt; {
			safe =&gt; 1,
			rebuild =&gt; 1,
		},
}

sub pagetemplate (@) {
	my %params=@_;

	my $template=$params{template};
	
	if ($template-&gt;query(name =&gt; "favicon")) {
		$template-&gt;param(favicon =&gt; "favicon.ico");
	}
}

1
</pre></body></html>