maunium / dontasktoask.com

An informational website about why you should ask questions directly instead of asking to ask
https://dontasktoask.com
MIT License
432 stars 97 forks source link

[Feature request] Making partials #86

Open alfawal opened 2 years ago

alfawal commented 2 years ago

Having a multiple files with almost the same header/footer(/sidebar) is a bad design. So we might consider breaking the layout into smaller flexible files using HTML's <!--#include file="partial.html"--> or EJS's <% include partials/partial.ejs %>. I do support moving into EJS because you can also pass some parameters in flexible ways. What do you think @tulir

tulir commented 2 years ago

The headers don't have that much content and the footer can be translated (meaning a partial wouldn't help there), so I don't think it's too bad right now, but I guess it'll be more relevant with #85.

Caddy templates and the include directive are the best way, no reason to involve JavaScript.