Change logic for setting page title

This commit is contained in:
G.Ambatte
2026-09-07 20:35:23 +12:00
parent 857257a1be
commit 9120a166c8
+14 -4
View File
@@ -21,6 +21,15 @@
let prefix = '';
// Default page title
let result ='The Homebrewery';
// Add brew title, if it exists
if (title) {
result = `${title} - ${result}`;
}
// Add prefix for Stage/PR Deployment/Local install
if (url && url?.includes('://homebrewery-stage.')) {
prefix = `Stage `;
} else if (url?.includes('://homebrewery-pr-')) {
@@ -30,12 +39,13 @@
prefix = 'Local ';
}
if (title) {
document.title = `${prefix} - ${title} - The Homebrewery`;
} else if (prefix) {
document.title = `${prefix} - The Homebrewery`;
if (prefix) {
result = `${prefix} - ${result}`;
}
// Set page title
document.title = result;
if (window.location.pathname.startsWith('/admin')) {
import('/client/admin/main.jsx');
} else {