Open daveaglick opened 5 years ago
Been thinking about this more and I think it’ll work really well:
__foo.html
Going to work on this soon, happy to see the original design from almost a year ago is still pretty relevant. Here's some clarifications:
RenderPostProcessTemplates
module right after the templates (but before things like MirrorResources
and ResolveXrefs
).
ProcessContentOverrides
module should be created and called inside the RenderPostProcessTemplates
<head>
content will be merged with the original document, whatever is in the <body>
is what will replace/modify the elements from the query selectorOverriddenElements
: query selector, all matching elements will be replaced/modified/appended/etc.OverridePosition
: replace, append, insert after, etc.OverridenSources
: globbing pattern(s) to filter the override to, if omitted overrides apply to all documents with destination paths in or under the same relative folder as the override
Most of the themes follow a convention for partials like
_Head.cshtml
but that could quickly become less widespread when new and community themes are created. Instead we need a way for the use of certain overrides to be intrinsic to the build regardless of theme. Shortcodes give us the power of a lightweight templating engine, so I’m thinking we bake in support for overrides like_Head.html
, run them through theShortcode
module, then use one of the HTML modules to inject them at the right place. Might even be able to come up with a convention to make this really flexible by specifying where to inject the override inside the override (as frontmatter?).