Bug related to decode call

Modify /usr/lib/x86_64-linux-gnu/perl/5.20/Encode.pm

sub decode($$;$) {
    my ( $name, $octets, $check ) = @_;
    return undef unless defined $octets;
    $octets .= '';
    $check ||= 0;
    my $enc = find_encoding($name);
    unless ( defined $enc ) {
        require Carp;
        Carp::croak("Unknown encoding '$name'");
    return $octets if Encode::is_utf8($octets); # Fix bug: do not decode already-decoded string 
    my $string = $enc->decode( $octets, $check );
    $_[1] = $octets if $check and !ref $check and !( $check & LEAVE_SRC() );
    return $string;


Default templates


On Linux, it's typically in /usr/share/ikiwiki/templates/.


If installing ikiwiki on macOS using 'pkgsrc', share/ikiwiki/templates/ should be relative to the root directory where all 'pkgsrc' files are installed, which is by default /opt/pkg/.

Computer-wide templates (applied to all Ikiwiki websites built on a computer)

Specify an additional directory for ikiwiki to look for templates:

$ ikiwiki --setup setupfile --templatedir '/Users/meng/my-config-files/Ikiwiki/templatedir' [more options]

or specify it in the setupfile:

use IkiWiki::Setup::Standard {
    templatedir => '/Users/meng/my-config-files/Ikiwiki/templatedir',

I intend to keep tempaltes applicable to all Ikiwiki websites in '/Users/lumeng/my-config-files/Ikiwiki/templatedir'.

Website-specific templates applied to only the current Ikiwiki website

In addition to the default templates and the user-configured templates applicable to all Ikiwiki websites, keep templates only applicable to the current Ikiwiki website in its own source directory 'sourcedir/templates/'.


  • https://ikiwiki.info/templates/
  • https://ikiwiki.info/forum/How_to_use_multiple_template_files_directories63/
blog comments powered by Disqus