mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-28 20:58:13 +00:00
fix title
This commit is contained in:
33
index.html
33
index.html
@@ -19,28 +19,23 @@
|
|||||||
<main id="reactRoot"></main>
|
<main id="reactRoot"></main>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
const url = window.__INITIAL_PROPS__.config.baseUrl;
|
const { config: { baseUrl: url }, brew: { title } } = window.__INITIAL_PROPS__;
|
||||||
console.log(window.__INITIAL_PROPS__);
|
|
||||||
const title = window.__INITIAL_PROPS__.brew.title;
|
|
||||||
|
|
||||||
if(title && title.length !== 0) {
|
let prefix = '';
|
||||||
document.title = `${title} - The Homebrewery`
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.includes('://homebrewery-pr-')) {
|
if (url.includes('://homebrewery-pr-')) {
|
||||||
const match = url.match(/pr-(\d+)/);
|
const match = url.match(/pr-(\d+)/);
|
||||||
if (match) {
|
if (match) prefix = `PR-${match[1]} `;
|
||||||
document.title = `PR-${match[1]} ` + document.title;
|
} else if (url.includes('://localhost')) {
|
||||||
}
|
prefix = 'LOCAL - ';
|
||||||
} else if (url.includes('://localhost:')) {
|
}
|
||||||
document.title = `LOCAL - ` + document.title;
|
|
||||||
|
if (title) {
|
||||||
}
|
document.title = `${prefix}${title} - The Homebrewery`;
|
||||||
if (window.location.pathname.startsWith('/admin')) {
|
}
|
||||||
import('/client/admin/main.jsx');
|
|
||||||
} else {
|
const isAdmin = window.location.pathname.startsWith('/admin');
|
||||||
import('/client/homebrew/main.jsx');
|
import(isAdmin ? '/client/admin/main.jsx' : '/client/homebrew/main.jsx');
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user