Comment by bob1029

Comment by bob1029 4 days ago

1 reply

With regard to templating approaches, my favorite by a very wide margin is to simply use string interpolation in the base language.

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).