by bob1029 · 1y ago · 0 comments
You create a common template type with methods like:
LayoutHtml(Session? Session, string title, string innerHtml, ...) => $@"
<html>
(common elements)
{innerHtml}
(common elements)
</html>";
Which is then fed html partial snippets generated however you see fit. The use of methods to abstract partials in a hierarchical fashion like this can manage complex layouts well. You can recurse and compose this structure as much as needed (i.e., partials inside partials).