Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions apps/docs/build/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ if (

export const META = {
version,
/**
* The docs package's manifest on GitHub, where `version` is set — on `main`,
* the branch the site deploys from, like the "View source" links.
*/
versionUrl: `${repoUrl}/blob/main/apps/docs/package.json`,
siteUrl,
repoUrl,
/** The repository without its scheme, e.g. `github.com/mixedrays/keyrove`. */
Expand Down Expand Up @@ -106,10 +111,10 @@ const PLACEHOLDER = /^<div data-about><\/div>$/gm;

const renderFacts = () =>
[
// Both versions, each beside what it numbers: the footer shows the
// package's, and a lone "Docs version" reads as the release it documents.
// Both versions, each beside what it numbers: a lone "Docs version" reads
// as the release it documents.
`- **Package** — [${META.packageName}](${META.npmUrl}) ${META.packageVersion} on npm`,
`- **Docs version** — ${META.version}, numbered separately from the package`,
`- **Docs version** — [${META.version}](${META.versionUrl}), numbered separately from the package`,
`- **Repository** — [${META.repoLabel}](${META.repoUrl})`,
`- **Author** — [@${META.author}](${META.authorUrl})`,
].join('\n');
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/components/site-chrome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function SiteFooter({ layout }: { layout: Layout }) {
keyrove
</SiteLink>
<span>
v{meta.packageVersion} &middot;{' '}
v{meta.packageVersion} &middot; docs v{meta.docsVersion} &middot;{' '}
<SiteLink href="/docs/license" className="footer-link">
MIT licensed
</SiteLink>
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/src/virtual.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ declare module 'virtual:docs/site' {

export const meta: {
packageVersion: string;
/** The docs package's own version, which moves when the site is released. */
docsVersion: string;
repoUrl: string;
npmUrl: string;
};
Expand Down
1 change: 1 addition & 0 deletions apps/docs/vite-plugin-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const toSiteModule = (site: Site, addresses: Addresses) => {
const data = {
meta: {
packageVersion: META.packageVersion,
docsVersion: META.version,
repoUrl: META.repoUrl,
npmUrl: META.npmUrl,
},
Expand Down
Loading