mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 16:08:54 +00:00
Change logic for setting page title
This commit is contained in:
+14
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user