Skip to content

Commit

Permalink
base url issues resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
DaKheera47 committed Mar 8, 2024
1 parent 7103e4b commit 2e5fa98
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
7 changes: 2 additions & 5 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import compress from "astro-compress";

// https://astro.build/config
export default defineConfig({
redirects: {
"/vectoraico.github.io/products": "/vectoraico.github.io/products/vfit"
},
integrations: [tailwind(), icon(), react(), compress()],
site: "https://project-mirage.github.io/vectoraico.github.io/",
base: "/vectoraico.github.io"
site: "https://vectoraico.github.io/",
base: "/",
});
7 changes: 4 additions & 3 deletions src/components/CustomLink.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
const { href, ...rest } = Astro.props;
const isExternal = href.startsWith("http://") || href.startsWith("https://");
const base = "";
// use if you want to prefix all links with a base
const base = "/vector-ai/";
const isExternal = href.startsWith("http://") || href.startsWith("https://");
const getPrefixedHref = (href: string) => {
// check if already prefixed
if (href.startsWith(`/${base}/`)) {
Expand All @@ -19,6 +20,6 @@ const getPrefixedHref = (href: string) => {
};
---

<a href={getPrefixedHref(href)} {...rest}>
<a href={href} {...rest}>
<slot />
</a>
2 changes: 1 addition & 1 deletion src/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const FloatingNav = ({
{navItems.map((navItem: any, idx: number) => (
<a
key={`link=${idx}`}
href={`/vector-ai${navItem.link}`}
href={`${navItem.link}`}
className={cn(
"relative flex items-center space-x-1 text-neutral-600 hover:text-neutral-500 dark:text-neutral-50 dark:hover:text-neutral-300",
)}
Expand Down
8 changes: 4 additions & 4 deletions src/components/footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { buttonVariants } from "./ui/button";
const links: Array<FooterLink> = [
{
url: "/vector-ai/",
url: "/",
description: "Vectors's official website",
icon: "mdi:home",
},
Expand Down Expand Up @@ -50,10 +50,10 @@ const navItems = [
>
<div class="sm:flex sm:items-center sm:justify-between">
<a
href="/vector-ai/"
href="/"
class="mb-4 flex items-center space-x-3 invert dark:invert-0 sm:mb-0"
>
<img src="/vector-ai/vector.png" class="h-8" alt="Vector Logo" />
<img src="/vector.png" class="h-8" alt="Vector Logo" />
</a>

<ul
Expand Down Expand Up @@ -111,7 +111,7 @@ const navItems = [
<div class="flex justify-center max-md:my-2 md:justify-start">
<span class="block text-sm sm:text-center"
{new Date().getFullYear()}
<a href="/vector-ai/" class="hover:underline">VECTOR</a>. All Rights
<a href="/" class="hover:underline">VECTOR</a>. All Rights
Reserved.
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/products/vfit.astro
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ import imageTwoAfter from "@/assets/slider_images/2_TryOn.jpg";
</div>

<ContentSection title="See it to believe it">
<video controls src="/vector-ai/vFitVideo.mp4" class="w-4/5"></video>
<video controls src="/vFitVideo.mp4" class="w-4/5"></video>
</ContentSection>
</Page>
2 changes: 1 addition & 1 deletion src/ui/card-hover-effect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const HoverEffect = ({
>
{items.map((item, idx) => (
<a
href={`/vector-ai/${item?.link}`}
href={`/${item?.link}`}
key={item?.link}
className="group relative block h-full w-full p-2"
onMouseEnter={() => setHoveredIndex(idx)}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/google-gemini-effect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const GoogleGeminiEffect = ({
<div className={cn("sticky top-72", className)}>
<div className="flex w-full justify-center">
<img
src="/vector-ai/vector.png"
src="/vector.png"
alt="vector logo"
className="absolute -top-[170px] w-48"
/>
Expand Down

0 comments on commit 2e5fa98

Please sign in to comment.