Skip to content

Commit 9111a9e

Browse files
committed
reviews, cleanups, PR pipeline
1 parent d427e8f commit 9111a9e

File tree

15 files changed

+1049
-322
lines changed

15 files changed

+1049
-322
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
concurrency:
8+
group: ci-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 22
22+
23+
- name: Enable Corepack
24+
run: corepack enable
25+
26+
- name: Install dependencies
27+
run: yarn install --immutable
28+
29+
- name: Astro check
30+
run: yarn check
31+
32+
- name: Lint
33+
run: yarn lint
34+
35+
- name: Format check
36+
run: yarn prettier --check .
37+
38+
- name: Build
39+
run: yarn build

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"author": "Gallay Lajos <gallay.lajos@gmail.com>",
88
"license": "MIT",
99
"scripts": {
10+
"check": "astro check",
1011
"dev": "astro dev",
1112
"build": "astro build",
1213
"preview": "astro preview",
@@ -19,6 +20,7 @@
1920
},
2021
"packageManager": "yarn@4.13.0",
2122
"dependencies": {
23+
"@astrojs/check": "^0.9.6",
2224
"@astrojs/rss": "^4.0.15",
2325
"@astrojs/sitemap": "^3.7.0",
2426
"astro": "^5.18.0",

src/components/SiteNav.astro

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
import { SOCIAL, SITE_TITLE } from '../consts';
3+
import GitHubIcon from './icons/GitHubIcon.astro';
4+
import XIcon from './icons/XIcon.astro';
35
46
interface Props {
57
isHome?: boolean;
@@ -8,14 +10,19 @@ interface Props {
810
const { isHome = false } = Astro.props;
911
---
1012

11-
<nav class="site-nav">
13+
<nav class="site-nav" aria-label="Main navigation">
1214
<div class="site-nav-left">
1315
{!isHome && (
1416
<a class="site-nav-logo" href="/">
1517
<img src="/images/furystack-logo-512.png" alt={SITE_TITLE} />
1618
<span>FuryStack</span>
1719
</a>
1820
)}
21+
<button class="nav-toggle" aria-label="Toggle navigation" aria-expanded="false">
22+
<span class="nav-toggle-bar"></span>
23+
<span class="nav-toggle-bar"></span>
24+
<span class="nav-toggle-bar"></span>
25+
</button>
1926
<ul class="nav" role="menu">
2027
<li role="menuitem"><a href="/">Home</a></li>
2128
<li role="menuitem"><a href="/tags/getting-started/">Getting Started</a></li>
@@ -26,17 +33,31 @@ const { isHome = false } = Astro.props;
2633
<div class="site-nav-right">
2734
{SOCIAL.github && (
2835
<a class="social-link" href={SOCIAL.github} target="_blank" rel="noopener noreferrer" title="GitHub">
29-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 16 16"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
36+
<GitHubIcon />
3037
</a>
3138
)}
3239
{SOCIAL.x && (
3340
<a class="social-link" href={SOCIAL.x} target="_blank" rel="noopener noreferrer" title="X (Twitter)">
34-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865z"/></svg>
41+
<XIcon />
3542
</a>
3643
)}
3744
</div>
3845
</nav>
3946

47+
<script>
48+
document.addEventListener('astro:page-load', () => {
49+
const toggle = document.querySelector('.nav-toggle');
50+
const nav = document.querySelector('.site-nav .nav');
51+
if (!toggle || !nav) return;
52+
53+
toggle.addEventListener('click', () => {
54+
const expanded = toggle.getAttribute('aria-expanded') === 'true';
55+
toggle.setAttribute('aria-expanded', String(!expanded));
56+
nav.classList.toggle('nav-open');
57+
});
58+
});
59+
</script>
60+
4061
<style>
4162
.site-nav {
4263
position: relative;
@@ -69,6 +90,30 @@ const { isHome = false } = Astro.props;
6990
.site-nav-logo:hover { text-decoration: none; opacity: 0.9; }
7091
.site-nav-logo img { width: 24px; height: 24px; border-radius: 4px; }
7192

93+
.nav-toggle {
94+
display: none;
95+
flex-direction: column;
96+
justify-content: center;
97+
gap: 4px;
98+
width: 36px;
99+
height: 36px;
100+
padding: 8px;
101+
background: transparent;
102+
border: none;
103+
cursor: pointer;
104+
border-radius: 6px;
105+
transition: background 0.15s ease;
106+
}
107+
.nav-toggle:hover { background: rgba(255, 255, 255, 0.08); }
108+
.nav-toggle-bar {
109+
display: block;
110+
width: 100%;
111+
height: 2px;
112+
background: rgba(255, 255, 255, 0.75);
113+
border-radius: 1px;
114+
transition: transform 0.2s ease, opacity 0.2s ease;
115+
}
116+
72117
.nav {
73118
display: flex;
74119
gap: 2px;
@@ -92,8 +137,21 @@ const { isHome = false } = Astro.props;
92137
}
93138

94139
@media (max-width: 700px) {
95-
.nav { gap: 0; }
96-
.nav li a { padding: 8px 8px; font-size: 1.3rem; }
140+
.nav-toggle { display: flex; }
141+
.nav {
142+
display: none;
143+
position: absolute;
144+
top: 64px;
145+
left: 0;
146+
right: 0;
147+
flex-direction: column;
148+
background: var(--color-nav-bg);
149+
padding: 8px 16px 16px;
150+
border-top: 1px solid rgba(255, 255, 255, 0.08);
151+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
152+
}
153+
.nav.nav-open { display: flex; }
154+
.nav li a { padding: 10px 12px; font-size: 1.5rem; }
97155
.site-nav-logo span { display: none; }
98156
.site-nav-logo { margin-right: 8px; }
99157
.site-nav-left { padding-left: 5vw; }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
interface Props {
3+
size?: number;
4+
}
5+
6+
const { size = 18 } = Astro.props;
7+
---
8+
9+
<svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} fill="currentColor" viewBox="0 0 16 16"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>

src/components/icons/XIcon.astro

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
interface Props {
3+
size?: number;
4+
}
5+
6+
const { size = 16 } = Astro.props;
7+
---
8+
9+
<svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} fill="currentColor" viewBox="0 0 16 16"><path d="M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865z"/></svg>

src/layouts/BaseLayout.astro

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
---
22
import '../styles/global.css';
3+
import { ClientRouter } from 'astro:transitions';
4+
import SiteNav from '../components/SiteNav.astro';
5+
import Footer from '../components/Footer.astro';
36
import { SITE_TITLE, SITE_DESCRIPTION, SITE_LANG } from '../consts';
47
58
interface Props {
69
title?: string;
710
description?: string;
811
ogImage?: string;
912
ogType?: string;
13+
isHome?: boolean;
1014
}
1115
1216
const {
1317
title = SITE_TITLE,
1418
description = SITE_DESCRIPTION,
1519
ogImage,
1620
ogType = 'website',
21+
isHome = false,
1722
} = Astro.props;
1823
1924
const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
@@ -24,6 +29,7 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
2429
<head>
2530
<meta charset="utf-8" />
2631
<meta name="viewport" content="width=device-width, initial-scale=1" />
32+
<meta name="generator" content={Astro.generator} />
2733
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
2834
<link rel="canonical" href={canonicalUrl} />
2935
<link rel="sitemap" href="/sitemap-index.xml" />
@@ -34,6 +40,10 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
3440
href={new URL('/rss.xml', Astro.site)}
3541
/>
3642

43+
<link rel="preconnect" href="https://fonts.googleapis.com" />
44+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
45+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
46+
3747
<title>{title}</title>
3848
<meta name="description" content={description} />
3949

@@ -49,8 +59,36 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
4959
<meta name="twitter:description" content={description} />
5060
<meta name="twitter:url" content={canonicalUrl} />
5161
{ogImage && <meta name="twitter:image" content={ogImage} />}
62+
63+
<ClientRouter />
5264
</head>
5365
<body>
66+
<a class="skip-link" href="#main-content">Skip to content</a>
67+
<div class="site-nav-main">
68+
<div class="inner" style="padding: 0 5vw;">
69+
<SiteNav isHome={isHome} />
70+
</div>
71+
</div>
5472
<slot />
73+
<Footer />
5574
</body>
5675
</html>
76+
77+
<style>
78+
.skip-link {
79+
position: absolute;
80+
top: -100%;
81+
left: 16px;
82+
z-index: 9999;
83+
padding: 8px 16px;
84+
background: var(--color-accent);
85+
color: #fff;
86+
font-size: 1.4rem;
87+
font-weight: 600;
88+
border-radius: 0 0 6px 6px;
89+
text-decoration: none;
90+
}
91+
.skip-link:focus {
92+
top: 0;
93+
}
94+
</style>

0 commit comments

Comments
 (0)