mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-27 05:58:10 +00:00
Merge branch 'master' of https://github.com/naturalcrit/homebrewery into update-Codemirror
This commit is contained in:
23
index.html
23
index.html
@@ -19,7 +19,28 @@
|
||||
<main id="reactRoot"></main>
|
||||
|
||||
<script type="module">
|
||||
if (window.location.pathname.startsWith('/admin')) {
|
||||
const props = window.__INITIAL_PROPS__ || {};
|
||||
const url = props.config?.baseUrl;
|
||||
const title = props.brew?.title;
|
||||
|
||||
let prefix = '';
|
||||
|
||||
if (url.includes('://homebrewery-stage.')) {
|
||||
prefix = `Stage `;
|
||||
} else if (url.includes('://homebrewery-pr-')) {
|
||||
const match = url.match(/pr-(\d+)/);
|
||||
if (match) prefix = `PR-${match[1]} `;
|
||||
} else if (url.includes('://localhost')) {
|
||||
prefix = 'Local ';
|
||||
}
|
||||
|
||||
if (title) {
|
||||
document.title = `${prefix} - ${title} - The Homebrewery`;
|
||||
} else {
|
||||
document.title = `${prefix} - The Homebrewery`;
|
||||
}
|
||||
|
||||
if (window.location.pathname.startsWith('/admin')) {
|
||||
import('/client/admin/main.jsx');
|
||||
} else {
|
||||
import('/client/homebrew/main.jsx');
|
||||
|
||||
Reference in New Issue
Block a user