(path: string)
| 35 | } |
| 36 | |
| 37 | export function withBasePath(path: string) { |
| 38 | if (/^https?:\/\//.test(path)) return path |
| 39 | |
| 40 | const base = import.meta.env.BASE_URL |
| 41 | if (base === '/') return path |
| 42 | |
| 43 | return `${base.replace(/\/$/, '')}/${path.replace(/^\//, '')}` |
| 44 | } |
| 45 | |
| 46 | export function publicTheme(theme: Theme) { |
| 47 | const { data } = theme |