Skip to content

Commit 8438f42

Browse files
authored
fix: Add the Packagist link beside GitHub and pad the promise list. (#1)
1 parent af961ee commit 8438f42

5 files changed

Lines changed: 29 additions & 6 deletions

File tree

‎src/components/SiteBar.astro‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
/**
3-
* The bar on top of every page: the brand that leads home, the way to search, the organization on GitHub
4-
* and the theme control.
3+
* The bar on top of every page: the brand that leads home, the way to search, the organization on GitHub and
4+
* on Packagist, and the theme control.
55
*/
66
import { SITE, TEXT } from '../content/site'
77
import BrandMark from './BrandMark.astro'
@@ -29,6 +29,16 @@ import ThemeToggle from './ThemeToggle.astro'
2929
>
3030
<Icon name="github" size={18} />
3131
</a>
32+
<a
33+
href={SITE.packagist}
34+
target="_blank"
35+
rel="noopener noreferrer"
36+
class="tb-bar__tool"
37+
aria-label={TEXT.nav.packagist}
38+
title={TEXT.nav.packagist}
39+
>
40+
<Icon name="packagist" size={18} />
41+
</a>
3242
</div>
3343
<ThemeToggle theme={TEXT.theme} />
3444
</div>

‎src/components/SiteFooter.astro‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,21 @@ import Icon from './Icon.astro'
99
href={SITE.github}
1010
target="_blank"
1111
rel="noopener noreferrer"
12-
class="tb-footer__github"
12+
class="tb-footer__link"
1313
aria-label={TEXT.nav.source}
1414
title={TEXT.nav.source}
1515
>
1616
<Icon name="github" size={20} />
1717
</a>
18+
<a
19+
href={SITE.packagist}
20+
target="_blank"
21+
rel="noopener noreferrer"
22+
class="tb-footer__link"
23+
aria-label={TEXT.nav.packagist}
24+
title={TEXT.nav.packagist}
25+
>
26+
<Icon name="packagist" size={20} />
27+
</a>
1828
</div>
1929
</footer>

‎src/components/icons.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const ICONS = {
1010
external: '<path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/>',
1111
github:
1212
'<path d="M9 19c-4.3 1.4-4.3-2.5-6-3m12 5v-3.5c0-1 .1-1.4-.5-2 2.8-.3 5.5-1.4 5.5-6a4.6 4.6 0 0 0-1.3-3.2 4.2 4.2 0 0 0-.1-3.2s-1.1-.3-3.5 1.3a12.3 12.3 0 0 0-6.2 0C6.5 2.8 5.4 3.1 5.4 3.1a4.2 4.2 0 0 0-.1 3.2A4.6 4.6 0 0 0 4 9.5c0 4.6 2.7 5.7 5.5 6-.6.6-.6 1.2-.5 2V21"/>',
13+
packagist: '<path d="M12 3 4 7.5v9L12 21l8-4.5v-9L12 3Z"/><path d="M4 7.5 12 12l8-4.5M12 12v9"/>',
1314
} as const
1415

1516
export type IconName = keyof typeof ICONS

‎src/content/site.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ORGANIZATION } from './catalog'
77
export const SITE = {
88
name: 'Tiny Blocks',
99
github: `https://github.com/${ORGANIZATION}`,
10+
packagist: `https://packagist.org/packages/${ORGANIZATION}/`,
1011
meta: {
1112
title: 'Tiny Blocks · Small, focused PHP libraries',
1213
description:
@@ -26,6 +27,7 @@ export const TEXT = {
2627
libraries: 'Libraries',
2728
toTop: 'Back to top',
2829
source: 'Tiny Blocks on GitHub',
30+
packagist: 'Tiny Blocks on Packagist',
2931
},
3032
home: {
3133
lede: 'Small, focused PHP libraries. Each one solves a single problem and can be adopted on its own, without pulling in the rest.',

‎src/styles/theme.css‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,17 +477,18 @@ code {
477477
.tb-footer__inner {
478478
display: flex;
479479
justify-content: center;
480+
gap: 0.5rem;
480481
padding-block: 1.25rem;
481482
}
482-
.tb-footer__github {
483+
.tb-footer__link {
483484
display: grid;
484485
place-items: center;
485486
width: 2.75rem;
486487
height: 2.75rem;
487488
border-radius: var(--radius-pill);
488489
color: var(--color-ink-muted);
489490
}
490-
.tb-footer__github:hover {
491+
.tb-footer__link:hover {
491492
background: var(--color-surface-strong);
492493
color: var(--color-ink);
493494
}
@@ -1195,7 +1196,6 @@ a.tb-chip:hover {
11951196
padding: 1.5rem;
11961197
border-radius: var(--radius-lg);
11971198
border: 1px dashed var(--color-tb-brand);
1198-
padding: 0;
11991199
list-style: none;
12001200
}
12011201
.tb-promise li {

0 commit comments

Comments
 (0)