Update page title when navigating through directories

Fix for the #5380 issue.