Add function to dynamically generate page titles