Refactor Site#render

Shorten and simplify the code in `Site#render`, removing duplication.