share page-title setting code between server and client.