fix: use BASE_PATH for favicon references in subpath deployments
Hardcoded /favicon.svg paths skip the <base> tag and fail when served from a subpath like /server/. Now uses config.basePath in TSX and a relative href in index.html so the <base> tag resolves correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Cameleer3</title>
|
<title>Cameleer3</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export function LoginPage() {
|
|||||||
<Card className={styles.card}>
|
<Card className={styles.card}>
|
||||||
<div className={styles.loginForm}>
|
<div className={styles.loginForm}>
|
||||||
<div className={styles.logo}>
|
<div className={styles.logo}>
|
||||||
<img src="/favicon.svg" alt="" className={styles.logoImg} />
|
<img src={`${config.basePath}favicon.svg`} alt="" className={styles.logoImg} />
|
||||||
cameleer3
|
cameleer3
|
||||||
</div>
|
</div>
|
||||||
<p className={styles.subtitle}>{subtitle}</p>
|
<p className={styles.subtitle}>{subtitle}</p>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Outlet, useNavigate, useLocation } from 'react-router';
|
import { Outlet, useNavigate, useLocation } from 'react-router';
|
||||||
|
import { config } from '../config';
|
||||||
import {
|
import {
|
||||||
AppShell,
|
AppShell,
|
||||||
Sidebar,
|
Sidebar,
|
||||||
@@ -616,7 +617,7 @@ function LayoutContent() {
|
|||||||
|
|
||||||
// --- Render -------------------------------------------------------
|
// --- Render -------------------------------------------------------
|
||||||
const camelLogo = (
|
const camelLogo = (
|
||||||
<img src="/favicon.svg" alt="" style={{ width: 28, height: 24 }} />
|
<img src={`${config.basePath}favicon.svg`} alt="" style={{ width: 28, height: 24 }} />
|
||||||
);
|
);
|
||||||
|
|
||||||
const sidebarElement = (
|
const sidebarElement = (
|
||||||
|
|||||||
Reference in New Issue
Block a user