summaryrefslogtreecommitdiff
path: root/doc/todo/allow_site-wide_meta_definitions.mdwn
blob: 3d506965fa911f7ceed5cff4040bda7fb5e44b4e (plain)

[[!tag plugins/meta patch]] [[!template id=gitbranch branch=jon/defaultmeta author="[[Jon]]"]]

I'd like to define [[plugins/meta]] values to apply across all pages site-wide unless the pages define their own: default values for meta definitions essentially.

<snip old patch, see below for latest>

-- [[Jon]]

This doesn't support multiple-argument meta directives like link=x rel=y, or meta directives with special side-effects like updated.

The first could be solved (if you care) by a syntax like this:

meta_defaults => [
    { copyright => "© me" },
    { link => "about:blank", rel => "silly", },
]

The second could perhaps be solved by invoking meta::preprocess from within scan (which might be a simplification anyway), although this is complicated by the fact that some (but not all!) meta headers are idempotent.

--[[smcv]]

Thanks for your comment. I've revised the patch to use the config syntax you suggest. I need to perform some more testing to make sure I've addressed the issues you highlight.

I had to patch part of IkiWiki core, the merge routine in Setup, because the use of possibly_foolish_untaint was causing the hashrefs at the deep end of the data structure to be converted into strings. The specific change I've made may not be acceptable, though -- I'd appreciate someone providing some feedback on that hunk!

-- [[Jon]]