Fixed #266 -- Use URL resolving in templates

You're totally right.