Skip to content

Commit 50199de

Browse files
committed
chore(site): improve design
1 parent 89335c3 commit 50199de

File tree

11 files changed

+395
-44
lines changed

11 files changed

+395
-44
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
github: JamieMason
2+
ko_fi: jamiemason
3+
thanks_dev: u/gh/JamieMason

.gitignore

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
.idea
77
coverage/
88
dist/
9+
flamegraph.svg
10+
lcp_trace.json
911
node_modules/
12+
npm/packages/
1013
target/
11-
12-
# Generated packages published to npm
13-
npm/packages
14-
15-
# Benchmarks
16-
flamegraph.svg

pnpm-lock.yaml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/astro.config.mjs

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,16 @@ export default defineConfig({
159159
label: 'GitHub',
160160
href: 'https://github.com/JamieMason/syncpack',
161161
},
162+
{
163+
icon: 'npm',
164+
label: 'npm',
165+
href: 'https://npmx.dev/package/syncpack',
166+
},
162167
{
163168
icon: 'blueSky',
164169
label: 'Bluesky',
165170
href: 'https://bsky.app/profile/foldleft.bsky.social',
166171
},
167-
{
168-
icon: 'x.com',
169-
label: 'X',
170-
href: 'https://x.com/fold_left',
171-
},
172172
],
173173
editLink: {
174174
baseUrl: 'https://github.com/JamieMason/syncpack/edit/main/site/',
@@ -177,17 +177,35 @@ export default defineConfig({
177177
logo: {
178178
src: './src/assets/logo.svg',
179179
},
180+
tableOfContents: {
181+
minHeadingLevel: 2,
182+
maxHeadingLevel: 4,
183+
},
180184
expressiveCode: {
181-
themes: ['github-light-default', 'github-dark-default'],
182-
removeUnusedThemes: false,
185+
themes: ['everforest-dark', 'everforest-light'],
186+
frames: false,
187+
styleOverrides: {
188+
// Borders and spacing
189+
borderRadius: '6px',
190+
borderWidth: '1px',
191+
borderColor: 'var(--sl-color-gray-5)',
192+
193+
// Code area
194+
codeBackground: 'var(--sl-color-gray-6)',
195+
codeFontFamily: 'var(--sl-font-mono)',
196+
codeFontSize: '0.8rem',
197+
codeLineHeight: '1.65',
198+
codePaddingBlock: '1rem',
199+
codePaddingInline: '1.35rem',
200+
codeForeground: 'var(--sl-color-gray-2)',
201+
202+
// Accent color for highlights
203+
focusBorder: 'var(--sl-color-accent)',
204+
},
183205
},
184-
customCss: ['./src/styles/custom.css'],
206+
customCss: ['@fontsource-variable/inter', '@fontsource-variable/jetbrains-mono', './src/styles/custom.css'],
185207
pagination: false,
186208
sidebar: [
187-
{
188-
label: 'Github',
189-
link: 'https://github.com/JamieMason/syncpack',
190-
},
191209
{
192210
label: 'Guides',
193211
autogenerate: { directory: 'guide' },
@@ -230,7 +248,9 @@ export default defineConfig({
230248
},
231249
],
232250
components: {
251+
Footer: './src/components/Footer.astro',
233252
Head: './src/components/Head.astro',
253+
SocialIcons: './src/components/SocialIcons.astro',
234254
},
235255
head: [
236256
{

site/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"dependencies": {
55
"@astrojs/check": "^0.9.6",
66
"@astrojs/starlight": "^0.37.4",
7+
"@fontsource-variable/inter": "5.2.8",
8+
"@fontsource-variable/jetbrains-mono": "5.2.8",
79
"astro": "^5.16.16",
810
"rehype-external-links": "^3.0.0",
911
"satori-astro": "^0.3.3",
139 KB
Binary file not shown.
139 KB
Binary file not shown.

site/src/components/Footer.astro

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
import Default from '@astrojs/starlight/components/Footer.astro';
3+
import SponsorButton from './SponsorButton.astro';
4+
---
5+
6+
<Default />
7+
8+
<aside>
9+
<SponsorButton />
10+
<a href="https://www.npmjs.com/package/syncpack" rel="external nofollow">
11+
<img
12+
alt="NPM downloads"
13+
src="http://img.shields.io/npm/dm/syncpack.svg?style=flat-square"
14+
loading="lazy"
15+
/>
16+
</a>
17+
<a
18+
href="https://github.com/JamieMason/syncpack/actions"
19+
rel="external nofollow"
20+
>
21+
<img
22+
alt="Build Status"
23+
src="https://img.shields.io/github/actions/workflow/status/JamieMason/syncpack/ci.yaml?branch=main"
24+
loading="lazy"
25+
/>
26+
</a>
27+
</aside>
28+
29+
<style>
30+
a {
31+
font-size: 0;
32+
}
33+
34+
img {
35+
border-radius: 4px;
36+
}
37+
38+
aside {
39+
display: flex;
40+
align-items: center;
41+
align-content: center;
42+
gap: 1rem;
43+
justify-content: center;
44+
justify-items: center;
45+
}
46+
</style>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
import Default from '@astrojs/starlight/components/SocialIcons.astro';
3+
import SponsorButton from './SponsorButton.astro';
4+
---
5+
6+
<SponsorButton />
7+
8+
<Default />
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<a href="https://github.com/sponsors/JamieMason" rel="external">
2+
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" width="16">
3+
<path
4+
fill="rgb(219, 97, 162)"
5+
d="m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z"
6+
></path>
7+
</svg>
8+
Sponsor
9+
</a>
10+
11+
<style>
12+
a {
13+
display: inline-flex;
14+
align-items: center;
15+
justify-content: space-between;
16+
gap: 6px;
17+
padding: 4px 8px;
18+
border-radius: 6px;
19+
font-size: 0.76rem;
20+
font-weight: 500;
21+
text-decoration: none;
22+
transition:
23+
background-color 0.2s,
24+
border-color 0.2s;
25+
}
26+
27+
:root[data-theme="dark"] a {
28+
background-color: rgb(33, 40, 48);
29+
color: rgb(240, 246, 252);
30+
border: 1px solid rgb(61, 68, 77);
31+
32+
&:hover {
33+
background-color: rgb(48, 56, 65);
34+
border-color: rgb(84, 91, 100);
35+
}
36+
}
37+
38+
/* should look just like github's buttons */
39+
:root[data-theme="light"] a {
40+
background-color: #f6f8fa;
41+
color: #1f2328;
42+
border: 1px solid #d1d9e0;
43+
44+
&:hover {
45+
background-color: #eff2f5;
46+
border-color: #d1d9e0;
47+
}
48+
}
49+
50+
svg {
51+
display: inline-block;
52+
}
53+
</style>

0 commit comments

Comments
 (0)