Skip to content

Commit

Permalink
fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Mar 4, 2024
1 parent 0c09608 commit f56d73c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
3 changes: 2 additions & 1 deletion src/components/Button.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
const { link, style } = Astro.props;
const url = `${import.meta.env.BASE_URL}${link}`;
---

<a href={link} class={style}>
<a href={url} class={style}>
<slot name="pre-icon"><span></span></slot>
<slot />
<slot name="post-icon" />
Expand Down
3 changes: 2 additions & 1 deletion src/components/Link.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
const { href, style, noUnderline } = Astro.props;
const classList = `${style} ${noUnderline === 'true' ? 'no-link-underline' : ''}`;
const url = `${import.meta.env.BASE_URL}${href}`;
---
<!-- this is to prevent any unintended whitespace appearing after the link --><a href={href} class={classList}><slot/></a><style>
<!-- this is to prevent any unintended whitespace appearing after the link --><a href={url} class={classList}><slot/></a><style>
a {
@apply
text-tertiary-default
Expand Down
8 changes: 5 additions & 3 deletions src/components/Navbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import logo from "../images/logo.png"
import discord from "../images/discord.svg?raw"
import github from "../images/github.svg?raw"
import kofi from "../images/kofi.svg?raw"
const base = import.meta.env.BASE_URL;
---

<div class="
Expand All @@ -20,15 +22,15 @@ import kofi from "../images/kofi.svg?raw"
<p class="font-head text-xl text-accent-lightest">Globed</p>
</div>
<div class="flex flex-row justify-center max-sm:hidden">
<a href="/">
<a href={base}>
<HomeIcon/>
<span class="max-sm:hidden">Home</span>
</a>
<a href="/install">
<a href={`${base}/install`}>
<DownloadIcon/>
<span class="max-sm:hidden">Install</span>
</a>
<a href="/about">
<a href={`${base}/about`}>
<BookIcon/>
<span class="max-sm:hidden">About</span>
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const screenshots = (await Astro.glob('../images/screenshot-*.png')).map(file =>
About
</Button>

<Button link="./install" style="alt">
<Button link="/install" style="alt">
<ArrowRightIcon slot="post-icon" />
Install
</Button>
Expand Down

0 comments on commit f56d73c

Please sign in to comment.