Skip to content

Commit 0ff44ae

Browse files
feat: add Docs link and Star on GitHub button to header
- Custom Header component override with navigation links - Bump aeo.js to 0.0.7 Amp-Thread-ID: https://ampcode.com/threads/T-019ce7df-e49d-7279-8260-f10c88ad9413 Co-authored-by: Amp <amp@ampcode.com>
1 parent ff0e20f commit 0ff44ae

File tree

3 files changed

+85
-1
lines changed

3 files changed

+85
-1
lines changed

website/astro.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export default defineConfig({
2929
{ icon: 'github', label: 'GitHub', href: 'https://github.com/multivmlabs/aeo.js' },
3030
{ icon: 'npm', label: 'npm', href: 'https://www.npmjs.com/package/aeo.js' },
3131
],
32+
components: {
33+
Header: './src/components/Header.astro',
34+
},
3235
customCss: ['./src/styles/custom.css'],
3336
head: [
3437
{ tag: 'meta', attrs: { property: 'og:image', content: 'https://aeojs.org/og.png' } },

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@astrojs/starlight": "^0.38.1",
14-
"aeo.js": "^0.0.6",
14+
"aeo.js": "^0.0.7",
1515
"astro": "^6.0.1",
1616
"sharp": "^0.34.2"
1717
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
import Default from '@astrojs/starlight/components/Header.astro';
3+
---
4+
5+
<Default {...Astro.props}><slot /></Default>
6+
7+
<nav class="custom-header-links">
8+
<a href="/getting-started/introduction/" class="header-link">Docs</a>
9+
<a href="https://github.com/multivmlabs/aeo.js" target="_blank" rel="noopener" class="header-star-btn">
10+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
11+
Star on GitHub
12+
</a>
13+
</nav>
14+
15+
<style>
16+
.custom-header-links {
17+
display: flex;
18+
align-items: center;
19+
gap: 0.5rem;
20+
position: absolute;
21+
right: calc(var(--sl-nav-pad-x, 1rem) + 5rem);
22+
top: 50%;
23+
transform: translateY(-50%);
24+
}
25+
26+
.header-link {
27+
display: inline-flex;
28+
align-items: center;
29+
padding: 0.35rem 0.85rem;
30+
font-size: 0.85rem;
31+
font-weight: 500;
32+
color: var(--sl-color-gray-2);
33+
text-decoration: none;
34+
border-radius: 8px;
35+
transition: color 0.2s ease, background 0.2s ease;
36+
}
37+
38+
.header-link:hover {
39+
color: var(--sl-color-white);
40+
background: rgba(255, 255, 255, 0.06);
41+
}
42+
43+
.header-star-btn {
44+
display: inline-flex;
45+
align-items: center;
46+
gap: 0.4rem;
47+
padding: 0.35rem 0.85rem;
48+
font-size: 0.8rem;
49+
font-weight: 600;
50+
color: #000;
51+
text-decoration: none;
52+
border-radius: 8px;
53+
background: #fff;
54+
border: 1px solid rgba(255, 255, 255, 0.2);
55+
transition: all 0.2s ease;
56+
box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
57+
white-space: nowrap;
58+
}
59+
60+
.header-star-btn:hover {
61+
box-shadow: 0 0 20px rgba(255, 255, 255, 0.14);
62+
transform: translateY(-1px);
63+
}
64+
65+
:global([data-theme="light"]) .header-link:hover {
66+
background: rgba(0, 0, 0, 0.05);
67+
}
68+
69+
:global([data-theme="light"]) .header-star-btn {
70+
background: #000;
71+
color: #fff;
72+
border-color: #000;
73+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
74+
}
75+
76+
@media (max-width: 50rem) {
77+
.custom-header-links {
78+
display: none;
79+
}
80+
}
81+
</style>

0 commit comments

Comments
 (0)