Skip to content

Commit

Permalink
add base url header
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Jun 5, 2024
1 parent 6fb5a97 commit a6de2cf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
5 changes: 2 additions & 3 deletions landing/src/components/Footer.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<script>
import Github from '~/icons/Github.svelte'
import { i18n } from '$lib/i18n'
import { relativeURL } from '~/lib/utils'
const t = $i18n.t
</script>

<footer class="footer footer-center mt-36 p-10 bg-base-200 text-base-content rounded">
<nav class="grid grid-flow-col gap-4">
<a class="link link-hover" href={relativeURL('/')}>{t('home')}</a>
<a class="link link-hover" href={relativeURL('/')}>{t('features')}</a>
<a class="link link-hover" href="/">{t('home')}</a>
<a class="link link-hover" href="/features">{t('features')}</a>
<a class="link link-hover" href="https://github.com/thewh1teagle/vibe" target="_blank">Github</a>
<a class="link link-hover" href="https://github.com/sponsors/thewh1teagle" target="_blank">{t('support-vibe')}</a>
</nav>
Expand Down
5 changes: 2 additions & 3 deletions landing/src/components/Nav.svelte
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<script>
import Logo from '~/icons/Logo.svelte'
import { i18n } from '~/lib/i18n'
import { relativeURL } from '~/lib/utils'
const t = $i18n.t
</script>

<div class="navbar bg-base-100 lg:flex lg:max-w-[1065px] mt-3 m-auto">
<div class="flex-1">
<a href={relativeURL('/')} class="btn btn-ghost text-sm sm:btn-xs lg:btn-md lg:text-xl">
<a href="/" class="btn btn-ghost text-sm sm:btn-xs lg:btn-md lg:text-xl">
<Logo />
<span class="opacity-95">Vibe</span>
</a>
</div>
<!-- links -->
<ul class="flex-none menu menu-horizontal px-1" dir="ltr">
<li>
<a href={relativeURL('/features')}>{t('features')}</a>
<a href="/features">{t('features')}</a>
</li>
<li>
<a href="https://github.com/thewh1teagle/vibe" target="_blank">Github</a>
Expand Down
7 changes: 0 additions & 7 deletions landing/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
export function relativeURL(path: string) {
const baseURL = import.meta.env.PROD ? '/vibe' : ''
if (!path.startsWith('/')) {
path = '/' + path
}
return `${baseURL}${path}`
}
3 changes: 3 additions & 0 deletions landing/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import Footer from '~/components/Footer.svelte'
</script>

<head>
<base href="/vibe" />
</head>
<div dir={$i18n.dir()}>
<div>
{#if $isLoading}
Expand Down

0 comments on commit a6de2cf

Please sign in to comment.