@rxova/brand 0.15.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +52 -0
- package/README.md +16 -72
- package/package.json +5 -22
- package/src/feed.ts +6 -38
- package/src/fonts.css +2 -34
- package/src/index.ts +2 -9
- package/src/sites.links.test.ts +7 -12
- package/src/sites.test.ts +1 -5
- package/src/sites.ts +8 -42
- package/src/tokens.css +8 -29
- package/src/astro.css +0 -90
- package/src/chrome.css +0 -59
- package/src/components/Footer.astro +0 -20
- package/src/components/Header.astro +0 -170
- package/src/components/ProjectSwitcher.astro +0 -102
- package/src/components/SiteFooter.astro +0 -190
- package/src/components/SiteShell.astro +0 -188
- package/src/components/SiteTitle.astro +0 -46
- package/src/components/SocialIcons.astro +0 -21
- package/src/components/ThemeScript.astro +0 -55
- package/src/components/ThemeSelect.astro +0 -59
- package/src/components/ThemeToggle.astro +0 -197
- package/src/env.d.ts +0 -21
- package/src/footer.css +0 -146
- package/src/starlight.css +0 -178
- package/src/starlight.ts +0 -134
package/src/footer.css
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Styles for `components/SiteFooter.astro`.
|
|
3
|
-
*
|
|
4
|
-
* Its own file because the footer is the one piece of chrome both kinds of
|
|
5
|
-
* surface render: the three Starlight docs sites and the plain Astro ones
|
|
6
|
-
* (/blog, /updates, the landing). It used to live inside starlight.css, which
|
|
7
|
-
* is why /blog and /updates shipped a dot-separated link row instead — the
|
|
8
|
-
* shared footer would have rendered unstyled there.
|
|
9
|
-
*
|
|
10
|
-
* Imported by both `starlight.css` and `chrome.css`; nothing needs to import it
|
|
11
|
-
* directly. Written against `--rx-*` tokens only, so it does not depend on the
|
|
12
|
-
* short aliases chrome.css defines.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
@import './tokens.css';
|
|
16
|
-
|
|
17
|
-
.rx-footer {
|
|
18
|
-
margin-top: 4rem;
|
|
19
|
-
padding: 3rem 0 2rem;
|
|
20
|
-
border-top: 1px solid var(--rx-rule);
|
|
21
|
-
color: var(--rx-muted);
|
|
22
|
-
font-size: 0.875rem;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* The brand block and the link columns, side by side where there is room.
|
|
26
|
-
`auto-fit` rather than a media query because what matters is how wide the
|
|
27
|
-
footer's *container* is, not the viewport: on /blog the page measure is 44rem
|
|
28
|
-
on any screen, and a viewport query would have put the brand block beside the
|
|
29
|
-
columns and squeezed them to two cramped tracks on a desktop.
|
|
30
|
-
|
|
31
|
-
`min(100%, 20rem)` rather than a bare `20rem` for the track floor. A grid
|
|
32
|
-
track's minimum is not capped by its container, so a plain `minmax(20rem,
|
|
33
|
-
1fr)` stayed 320px wide inside a narrower footer and pushed the document
|
|
34
|
-
past the viewport — every rxova.org surface scrolled sideways on a 320px
|
|
35
|
-
phone, by the 24px of gutter the footer sits in. `min(100%, …)` lets the
|
|
36
|
-
floor collapse to the container, which is the same guard
|
|
37
|
-
`.rx-footer__columns` below already had. */
|
|
38
|
-
.rx-footer__top {
|
|
39
|
-
display: grid;
|
|
40
|
-
grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
|
|
41
|
-
gap: 2.5rem 3rem;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.rx-footer__brand {
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
gap: 0.75rem;
|
|
48
|
-
align-items: flex-start;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.rx-footer__mark {
|
|
52
|
-
display: inline-flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
gap: 0.55rem;
|
|
55
|
-
color: var(--rx-fg);
|
|
56
|
-
font-size: 1rem;
|
|
57
|
-
font-weight: 640;
|
|
58
|
-
letter-spacing: -0.01em;
|
|
59
|
-
text-decoration: none;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.rx-footer__mark img {
|
|
63
|
-
display: block;
|
|
64
|
-
border-radius: 6px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.rx-footer__blurb {
|
|
68
|
-
margin: 0;
|
|
69
|
-
max-width: 30ch;
|
|
70
|
-
color: var(--rx-faint);
|
|
71
|
-
line-height: 1.6;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* 8rem, not the 11rem this used to be: it is the widest track that still fits
|
|
75
|
-
two columns on a 360px phone, and one column of five-word links down the
|
|
76
|
-
whole width of a phone is a lot of scrolling for a footer. */
|
|
77
|
-
.rx-footer__columns {
|
|
78
|
-
display: grid;
|
|
79
|
-
grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
|
|
80
|
-
gap: 2rem 1.5rem;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.rx-footer__title {
|
|
84
|
-
margin-bottom: 0.75rem;
|
|
85
|
-
color: var(--rx-fg);
|
|
86
|
-
font-size: 0.75rem;
|
|
87
|
-
font-weight: 700;
|
|
88
|
-
letter-spacing: 0.06em;
|
|
89
|
-
text-transform: uppercase;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.rx-footer__list {
|
|
93
|
-
display: flex;
|
|
94
|
-
flex-direction: column;
|
|
95
|
-
gap: 0.45rem;
|
|
96
|
-
margin: 0;
|
|
97
|
-
padding: 0;
|
|
98
|
-
list-style: none;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.rx-footer__list a {
|
|
102
|
-
color: var(--rx-muted);
|
|
103
|
-
text-decoration: none;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.rx-footer__list a:hover {
|
|
107
|
-
color: var(--rx-fg);
|
|
108
|
-
text-decoration: underline;
|
|
109
|
-
text-underline-offset: 2px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/* The bottom bar: copyright on the left, the legal links on the right, and one
|
|
113
|
-
column on a phone. */
|
|
114
|
-
.rx-footer__legal {
|
|
115
|
-
display: flex;
|
|
116
|
-
align-items: center;
|
|
117
|
-
justify-content: space-between;
|
|
118
|
-
flex-wrap: wrap;
|
|
119
|
-
gap: 0.5rem 1.25rem;
|
|
120
|
-
margin-top: 2.5rem;
|
|
121
|
-
padding-top: 1.25rem;
|
|
122
|
-
border-top: 1px solid var(--rx-rule);
|
|
123
|
-
color: var(--rx-faint);
|
|
124
|
-
font-size: 0.8125rem;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.rx-footer__legal p {
|
|
128
|
-
margin: 0;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.rx-footer__legal-links {
|
|
132
|
-
display: flex;
|
|
133
|
-
align-items: center;
|
|
134
|
-
gap: 1.25rem;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.rx-footer__legal a {
|
|
138
|
-
color: var(--rx-faint);
|
|
139
|
-
text-decoration: none;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.rx-footer__legal a:hover {
|
|
143
|
-
color: var(--rx-fg);
|
|
144
|
-
text-decoration: underline;
|
|
145
|
-
text-underline-offset: 2px;
|
|
146
|
-
}
|
package/src/starlight.css
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps rxova tokens onto Starlight's theme variables.
|
|
3
|
-
*
|
|
4
|
-
* Load this from a Starlight site's `customCss`, which Astro appends after
|
|
5
|
-
* Starlight's own stylesheets — so these declarations win without !important.
|
|
6
|
-
*
|
|
7
|
-
* Every --rx-* neutral already flips between light and dark (see tokens.css),
|
|
8
|
-
* which is why one mapping block covers both modes. Starlight's own defaults
|
|
9
|
-
* are dark-in-:root / light-in-[data-theme='light']; we don't need that split
|
|
10
|
-
* because its inline head script always stamps an explicit data-theme before
|
|
11
|
-
* first paint.
|
|
12
|
-
*
|
|
13
|
-
* Starlight's gray ramp runs 1 (highest contrast) -> 7 (lowest), which is the
|
|
14
|
-
* same direction as our text -> surface ladder, so the mapping is monotonic in
|
|
15
|
-
* both modes.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
@import './tokens.css';
|
|
19
|
-
@import './footer.css';
|
|
20
|
-
|
|
21
|
-
:root {
|
|
22
|
-
/* Accent. */
|
|
23
|
-
--sl-color-accent: var(--rx-primary);
|
|
24
|
-
--sl-color-accent-low: color-mix(in srgb, var(--rx-primary) 20%, var(--rx-bg));
|
|
25
|
-
--sl-color-accent-high: var(--rx-primary-lightest);
|
|
26
|
-
--sl-color-text-accent: var(--rx-primary);
|
|
27
|
-
|
|
28
|
-
/* Neutral ladder. "white" and "black" are Starlight's names for the two
|
|
29
|
-
contrast extremes, not literal colours — they invert with the theme. */
|
|
30
|
-
--sl-color-white: var(--rx-fg);
|
|
31
|
-
--sl-color-gray-1: var(--rx-fg);
|
|
32
|
-
--sl-color-gray-2: var(--rx-muted);
|
|
33
|
-
--sl-color-gray-3: var(--rx-faint);
|
|
34
|
-
--sl-color-gray-4: var(--rx-rule-strong);
|
|
35
|
-
--sl-color-gray-5: var(--rx-rule);
|
|
36
|
-
--sl-color-gray-6: var(--rx-tag-bg);
|
|
37
|
-
--sl-color-gray-7: var(--rx-card);
|
|
38
|
-
--sl-color-black: var(--rx-bg);
|
|
39
|
-
|
|
40
|
-
/* Surfaces. Nav and sidebar sit flush with the page — the hairline does the
|
|
41
|
-
separating, not a fill change. */
|
|
42
|
-
--sl-color-bg: var(--rx-bg);
|
|
43
|
-
--sl-color-bg-nav: var(--rx-bg);
|
|
44
|
-
--sl-color-bg-sidebar: var(--rx-bg);
|
|
45
|
-
--sl-color-bg-inline-code: var(--rx-tag-bg);
|
|
46
|
-
--sl-color-bg-badge: var(--rx-tag-bg);
|
|
47
|
-
|
|
48
|
-
--sl-color-hairline: var(--rx-rule);
|
|
49
|
-
--sl-color-hairline-light: var(--rx-rule);
|
|
50
|
-
--sl-color-hairline-shade: var(--rx-rule-strong);
|
|
51
|
-
--sl-color-backdrop-overlay: color-mix(in srgb, var(--rx-bg) 80%, transparent);
|
|
52
|
-
|
|
53
|
-
/* Type. */
|
|
54
|
-
--sl-font: var(--rx-font-sans);
|
|
55
|
-
--sl-font-mono: var(--rx-font-mono);
|
|
56
|
-
|
|
57
|
-
--sl-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);
|
|
58
|
-
--sl-shadow-md: 0 4px 12px -4px rgb(0 0 0 / 0.12);
|
|
59
|
-
--sl-shadow-lg: var(--rx-shadow-soft);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/* Starlight ships a slightly cooler focus ring; align it with the accent. */
|
|
63
|
-
:root {
|
|
64
|
-
--sl-color-focus: var(--rx-primary);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* --- Shared chrome ------------------------------------------------------- */
|
|
68
|
-
|
|
69
|
-
/* The gradient is the brand's only chroma, so it earns exactly two placements:
|
|
70
|
-
the hairline under the site header, and the current-project dot in the
|
|
71
|
-
project switcher. Adding a third dilutes both. */
|
|
72
|
-
.site-title::after {
|
|
73
|
-
content: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
header.header {
|
|
77
|
-
border-bottom: 1px solid var(--sl-color-hairline);
|
|
78
|
-
background: var(--sl-color-bg-nav);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* In a schema-2 page bundle the umbrella header is rendered by rxova-website
|
|
82
|
-
outside Starlight's `.page`. Keep Starlight's own sticky documentation bar
|
|
83
|
-
below it instead of letting the two sticky headers occupy the same top edge. */
|
|
84
|
-
html[data-rxova-shell] {
|
|
85
|
-
--rx-shell-header-height: 3.5rem;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
html[data-rxova-shell] .page > header.header {
|
|
89
|
-
inset-block-start: var(--rx-shell-header-height);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
html[data-rxova-shell] .sidebar-pane {
|
|
93
|
-
inset-block-start: calc(var(--rx-shell-header-height) + var(--sl-nav-height));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
html[data-rxova-shell] mobile-starlight-toc nav {
|
|
97
|
-
top: calc(var(--rx-shell-header-height) + var(--sl-nav-height) - 1px);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* Starlight 0.42 dropped the <starlight-menu-button> wrapper for a bare
|
|
101
|
-
button.sl-menu-button; the peer range still covers the older markup. */
|
|
102
|
-
html[data-rxova-shell] starlight-menu-button button,
|
|
103
|
-
html[data-rxova-shell] .sl-menu-button {
|
|
104
|
-
top: calc(
|
|
105
|
-
var(--rx-shell-header-height) + (var(--sl-nav-height) - var(--sl-menu-button-size)) / 2
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@media (min-width: 72rem) {
|
|
110
|
-
html[data-rxova-shell] .right-sidebar {
|
|
111
|
-
top: var(--rx-shell-header-height);
|
|
112
|
-
height: calc(100vh - var(--rx-shell-header-height));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@media (max-width: 34rem) {
|
|
117
|
-
html[data-rxova-shell] {
|
|
118
|
-
--rx-shell-header-height: 3.25rem;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* Site title: the rxova mark sits beside the project wordmark. */
|
|
123
|
-
.rx-site-title {
|
|
124
|
-
display: flex;
|
|
125
|
-
align-items: center;
|
|
126
|
-
gap: 0.625rem;
|
|
127
|
-
color: var(--rx-fg);
|
|
128
|
-
font-weight: 600;
|
|
129
|
-
letter-spacing: -0.01em;
|
|
130
|
-
text-decoration: none;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.rx-site-title a {
|
|
134
|
-
color: inherit;
|
|
135
|
-
text-decoration: none;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.rx-site-title a:hover {
|
|
139
|
-
color: var(--rx-fg);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.rx-site-title img {
|
|
143
|
-
width: 28px;
|
|
144
|
-
height: 28px;
|
|
145
|
-
border-radius: var(--rx-radius-sm);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.rx-site-title__sep {
|
|
149
|
-
width: 1px;
|
|
150
|
-
height: 1.1rem;
|
|
151
|
-
background: var(--rx-rule-strong);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.rx-site-title__project {
|
|
155
|
-
color: var(--rx-muted);
|
|
156
|
-
font-weight: 500;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/* Project switcher. */
|
|
160
|
-
.rx-switcher {
|
|
161
|
-
position: relative;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.rx-switcher__current::before {
|
|
165
|
-
content: '';
|
|
166
|
-
display: inline-block;
|
|
167
|
-
width: 0.5rem;
|
|
168
|
-
height: 0.5rem;
|
|
169
|
-
margin-inline-end: 0.5rem;
|
|
170
|
-
border-radius: var(--rx-radius-pill);
|
|
171
|
-
background: var(--rx-gradient);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/* --- Footer -------------------------------------------------------------- */
|
|
175
|
-
|
|
176
|
-
/* Its styles are in footer.css, imported at the top of this file: /blog and
|
|
177
|
-
/updates render the same footer and load astro.css, not this one, so the
|
|
178
|
-
rules cannot live here. */
|
package/src/starlight.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Starlight configuration for the rxova docs sites.
|
|
3
|
-
*
|
|
4
|
-
* Each project's `astro.config.mjs` supplies only what is genuinely its own —
|
|
5
|
-
* its sidebar, its extra plugins — and spreads the rest from here, so the three
|
|
6
|
-
* doc sites cannot drift apart in the ways that made them feel like three
|
|
7
|
-
* unrelated products.
|
|
8
|
-
*
|
|
9
|
-
* Imported from `astro.config.mjs` under Node: no CSS, no component imports.
|
|
10
|
-
*
|
|
11
|
-
* The return type is structural rather than Starlight's own `StarlightUserConfig`.
|
|
12
|
-
* Spreading into `starlight({ ... })` still type-checks the merged object at the
|
|
13
|
-
* call site, and this way a Starlight minor release cannot break every consumer
|
|
14
|
-
* at once over a type-only change.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { RXOVA_ORIGIN, getProject, type ProjectId } from './sites.ts'
|
|
18
|
-
|
|
19
|
-
export interface SharedStarlightOptions {
|
|
20
|
-
/** Which project's docs this site is. */
|
|
21
|
-
project: ProjectId
|
|
22
|
-
/** Starlight sidebar config — the one thing every site defines itself. */
|
|
23
|
-
sidebar: unknown[]
|
|
24
|
-
/** Extra stylesheets, appended after the brand ones so they win. */
|
|
25
|
-
customCss?: string[]
|
|
26
|
-
/** Extra Starlight component overrides, merged over the shared ones. */
|
|
27
|
-
components?: Record<string, string>
|
|
28
|
-
/** Path under the repo root that holds the docs site, for the edit link. */
|
|
29
|
-
editLinkBase?: string
|
|
30
|
-
/**
|
|
31
|
-
* Build body-only documentation for rxova-website to place in its global
|
|
32
|
-
* shell. Starlight's search, sidebar and page navigation remain page UI; only
|
|
33
|
-
* the umbrella footer is omitted.
|
|
34
|
-
*/
|
|
35
|
-
pageComponent?: boolean
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function sharedStarlightConfig({
|
|
39
|
-
project,
|
|
40
|
-
sidebar,
|
|
41
|
-
customCss = [],
|
|
42
|
-
components = {},
|
|
43
|
-
editLinkBase = 'apps/docs',
|
|
44
|
-
pageComponent = false,
|
|
45
|
-
}: SharedStarlightOptions) {
|
|
46
|
-
const self = getProject(project)
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
title: self.label,
|
|
50
|
-
description: self.tagline,
|
|
51
|
-
// One origin, one tab icon. Each site must have this file in `public/` —
|
|
52
|
-
// Starlight resolves `favicon` against the site's own static directory, so
|
|
53
|
-
// it cannot come from this package.
|
|
54
|
-
favicon: '/favicon.svg',
|
|
55
|
-
|
|
56
|
-
// No `logo` here on purpose: the SiteTitle override renders the mark from
|
|
57
|
-
// this package's own assets, so adopting the shared chrome does not also
|
|
58
|
-
// mean copying an image into three repos and keeping it in sync.
|
|
59
|
-
|
|
60
|
-
social: [
|
|
61
|
-
{ icon: 'github' as const, label: 'GitHub', href: self.repo },
|
|
62
|
-
{ icon: 'npm' as const, label: 'npm', href: self.npm },
|
|
63
|
-
],
|
|
64
|
-
|
|
65
|
-
editLink: {
|
|
66
|
-
baseUrl: `${self.repo}/edit/main/${editLinkBase}/`,
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
// Order matters: fonts, then tokens+mapping, then per-site overrides.
|
|
70
|
-
customCss: ['@rxova/brand/fonts.css', '@rxova/brand/starlight.css', ...customCss],
|
|
71
|
-
|
|
72
|
-
components: {
|
|
73
|
-
// The rxova mark + project wordmark, with the mark linking back to the
|
|
74
|
-
// umbrella site. This is the only "you are inside rxova.org" affordance
|
|
75
|
-
// on a docs page, so it ships shared rather than per-repo.
|
|
76
|
-
SiteTitle: '@rxova/brand/components/SiteTitle.astro',
|
|
77
|
-
// Appends the cross-project switcher to the social icons. Without it the
|
|
78
|
-
// three docs sites are three islands under one domain.
|
|
79
|
-
SocialIcons: '@rxova/brand/components/SocialIcons.astro',
|
|
80
|
-
// Starlight's default footer (pagination, edit link, last updated) plus
|
|
81
|
-
// the shared four-column site footer beneath it.
|
|
82
|
-
...(!pageComponent ? { Footer: '@rxova/brand/components/Footer.astro' } : {}),
|
|
83
|
-
// Starlight's own picker, plus a resync when a page is restored from the
|
|
84
|
-
// back/forward cache — without it, changing the theme on one rxova.org
|
|
85
|
-
// surface and pressing Back leaves the restored page on the old theme.
|
|
86
|
-
ThemeSelect: '@rxova/brand/components/ThemeSelect.astro',
|
|
87
|
-
...components,
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
head: [
|
|
91
|
-
{
|
|
92
|
-
tag: 'meta' as const,
|
|
93
|
-
attrs: { property: 'og:image', content: `${RXOVA_ORIGIN}/og/${project}.png` },
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
tag: 'meta' as const,
|
|
97
|
-
attrs: { name: 'twitter:card', content: 'summary_large_image' },
|
|
98
|
-
},
|
|
99
|
-
// What this project *is*, in the vocabulary a crawler already parses.
|
|
100
|
-
//
|
|
101
|
-
// Every field is read from PROJECTS, so a project that changes its tagline
|
|
102
|
-
// or adds a package updates its structured data with it — the failure this
|
|
103
|
-
// avoids is the usual one for hand-written JSON-LD, which is that it
|
|
104
|
-
// describes the site as it was when someone last remembered to edit it.
|
|
105
|
-
//
|
|
106
|
-
// Emitted on every page of the docs rather than only the root: Starlight
|
|
107
|
-
// has no "site index only" hook, and repeating an identical
|
|
108
|
-
// SoftwareSourceCode across a subtree is well-formed — each page really is
|
|
109
|
-
// documentation for that one piece of software.
|
|
110
|
-
{
|
|
111
|
-
tag: 'script' as const,
|
|
112
|
-
attrs: { type: 'application/ld+json' },
|
|
113
|
-
content: JSON.stringify({
|
|
114
|
-
'@context': 'https://schema.org',
|
|
115
|
-
'@type': 'SoftwareSourceCode',
|
|
116
|
-
name: self.label,
|
|
117
|
-
description: self.tagline,
|
|
118
|
-
url: `${RXOVA_ORIGIN}${self.mount}`,
|
|
119
|
-
codeRepository: self.repo,
|
|
120
|
-
programmingLanguage: 'TypeScript',
|
|
121
|
-
runtimePlatform: 'Node.js',
|
|
122
|
-
license: 'https://opensource.org/licenses/MIT',
|
|
123
|
-
author: { '@type': 'Person', name: 'Jonatan Kruszewski' },
|
|
124
|
-
}).replace(/</g, '\\u003c'),
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
|
|
128
|
-
// Pagefind ships with Starlight and replaces the third-party search plugin
|
|
129
|
-
// journey was carrying.
|
|
130
|
-
pagefind: true,
|
|
131
|
-
|
|
132
|
-
sidebar,
|
|
133
|
-
}
|
|
134
|
-
}
|