Skip to content

Commit b7a0f8f

Browse files
committed
Correct css styles and paths
1 parent d5a9bb3 commit b7a0f8f

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import mdx from '@astrojs/mdx';
44
export default defineConfig({
55
integrations: [mdx()],
66
site: 'https://rmfisher26.github.io',
7-
base: '/guppyfisher',
7+
base: process.env.GITHUB_ACTIONS ? '/guppyfisher' : '/',
88
markdown: {
99
shikiConfig: {
1010
theme: 'catppuccin-mocha',

src/components/Header.astro

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
2+
const base = import.meta.env.BASE_URL;
23
const currentPath = Astro.url.pathname;
34
---
45
<header>
5-
<a href="/" class="site-logo">
6+
<a href={base} class="site-logo">
67
<span class="logo-fish">🐟</span>
78
GuppyFisher
89
</a>
910
<nav>
10-
<a href="/" class={currentPath === '/' ? 'active' : ''}>Posts</a>
11-
<a href="/series" class={currentPath.startsWith('/series') ? 'active' : ''}>Deep Dives</a>
12-
<a href="/series" class={currentPath.startsWith('/series') ? 'active' : ''}>Series</a>
13-
<a href="/about" class={currentPath === '/about' ? 'active' : ''}>About</a>
11+
<a href={base} class={currentPath === base || currentPath === base.slice(0,-1) ? 'active' : ''}>Posts</a>
12+
<a href={`${base}/series`} class={currentPath.startsWith(`${base}/series`) ? 'active' : ''}>Deep Dives</a>
13+
<a href={`${base}/series`} class={currentPath.startsWith(`${base}/series`) ? 'active' : ''}>Series</a>
14+
<a href={`${base}/about`} class={currentPath === `${base}/about` ? 'active' : ''}>About</a>
1415
</nav>
1516
<div class="header-right">
1617
<span class="tag-badge">Learning in Public</span>

src/layouts/Base.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import Footer from '../components/Footer.astro';
3+
import '../styles/global.css';
34
45
interface Props {
56
title: string;
@@ -16,7 +17,6 @@ const { title, description = 'Learning Guppylang compiler internals in public.'
1617
<meta name="description" content={description} />
1718
<link rel="preconnect" href="https://fonts.googleapis.com" />
1819
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&family=JetBrains+Mono:ital,wght@0,400;0,600;1,400&family=Lora:ital,wght@0,400;1,400;1,600&display=swap" />
19-
<link rel="stylesheet" href="/styles/global.css" />
2020
</head>
2121
<body>
2222
<slot />

src/layouts/PostLayout.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const formattedDate = new Date(frontmatter.pubDate).toLocaleDateString('en-US',
2525
<Header />
2626

2727
<div class="back-link">
28-
<a href="/">← All posts</a>
28+
<a href={import.meta.env.BASE_URL}>← All posts</a>
2929
</div>
3030

3131
<article>
@@ -61,7 +61,7 @@ const formattedDate = new Date(frontmatter.pubDate).toLocaleDateString('en-US',
6161
</div>
6262

6363
<footer class="post-footer">
64-
<a href="/" class="back-btn">← Back to all posts</a>
64+
<a href={import.meta.env.BASE_URL} class="back-btn">← Back to all posts</a>
6565
</footer>
6666
</article>
6767
</Base>

0 commit comments

Comments
 (0)