SEO improvements
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m0s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m0s
This commit is contained in:
@@ -208,6 +208,12 @@ const routes = {
|
||||
"/rankings": "rankings",
|
||||
};
|
||||
|
||||
const pageTitles = {
|
||||
dashboard: "SchoolCompare | Compare Primary School Performance",
|
||||
compare: "Compare Schools | SchoolCompare",
|
||||
rankings: "School Rankings | SchoolCompare",
|
||||
};
|
||||
|
||||
function navigateTo(path) {
|
||||
// Update URL without reload
|
||||
window.history.pushState({}, "", path);
|
||||
@@ -218,6 +224,9 @@ function handleRoute() {
|
||||
const path = window.location.pathname;
|
||||
const view = routes[path] || "dashboard";
|
||||
|
||||
// Update page title for SEO
|
||||
document.title = pageTitles[view] || pageTitles.dashboard;
|
||||
|
||||
// Update navigation
|
||||
document.querySelectorAll(".nav-link").forEach((link) => {
|
||||
link.classList.toggle("active", link.dataset.view === view);
|
||||
|
||||
Reference in New Issue
Block a user