For an ikiwiki source directory, I already have multiple paths for storing template files:
- /opt/pkg/share/ikiwiki/templates/*.tmpl which came to be as a result of installing ikiwiki via pkgsrc on macOS;
- /Users/XXX/config/ikiwiki/templatedir/, a manually created directory for storing *.tmpl files potentially modified by myself but intended to use for all my ikiwiki sites;
- /Ysers/XXX/mywiki-srcdir/templates/*.tmpl, which according to https://ikiwiki.info/usage/ is another option to store template files. I intend to store template files potentially modified and only suitable for the particular instance 'mywiki-srcdir'.
I want all three paths to be usable for compiling mywiki-scrdir but want 3 be the default, which should fall back to 2 if a file is missing, which in turn should fall back to 1, if a file is missing.
The exact setup you asked for is not currently possible because
templatedir
only takes one value, but you can get the same practical result with an underlay:/Users/XXX/config/ikiwiki/common-files/
or something (the exact name is not significant, use whatever you want)/Users/XXX/config/ikiwiki/common-files/templates/*.tmpl
(it has to be atemplates/
subdirectory)add_plugins
config option/Users/XXX/config/ikiwiki/common-files
to theadd_underlays
config option (same syntax asadd_plugins
)This is priority 2 from your list: it's "less important" than the
templates/
subdirectory of thesrcdir
, but "more important" than the templates shipped with ikiwiki.If you create non-template pages or attachments in that underlay, they will also be considered "less important" than pages or attachments of the same name in the
srcdir
, but "more important" than ikiwiki'sbasewiki
underlay. I use an underlay like this to make smcv.pseudorandom.co.uk and www.pseudorandom.co.uk share a stylesheet.