message: added support for multiple engines
diff: @@ -422,18 +422,18 @@ export default class Site {
  * Render a page
  */
  async #renderPage(page) {
  - const engine = this.#getEngine(page.src.ext);
  -
  let content = page.content;
  let pageData = { ...page.fullData, ...this.extraData };
  let layout = pageData.layout;
  + let path = page.src.path + page.src.ext;
  + const engine = this.#getEngine(page.src.ext, pageData.templateEngine);
  - if (engine) {
  - content = await engine.render(
  - content,
  - pageData,
  - page.src.path + page.src.ext,
  - );
  + if (Array.isArray(engine)) {
  + for (const eng of engine) {
  + content = await eng.render(content, pageData, path);
  + }
  + } else if (engine) {
  + await engine.render(content, pageData, path);
  }
  while (layout) {
  @@ -480,7 +480,21 @@ export default class Site {
  /**
  * Get the engine used by a path or extension
  */
  - #getEngine(path) {
  + #getEngine(path, custom) {
  + if (custom) {
  + custom = Array.isArray(custom) ? custom : custom.split(",");
  +
  + return custom.map((name) => {
  + const engine = this.engines.get(`.${name.trim()}`);
  +
  + if (engine) {
  + return engine;
  + }
  +
  + throw new Error(`Invalid template engine: "${name}"`);
  + });
  + }
  +
  for (const [ext, engine] of this.engines) {
  if (path.endsWith(ext)) {
  return engine;
  