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
2 changes: 1 addition & 1 deletion site/app/(docs)/[[...slug]]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default async function Page(props) {
notFound();
const MDX = page.data.body;
return (<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsTitle className="fd-title">{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX components={getMDXComponents({
Expand Down
7 changes: 4 additions & 3 deletions site/app/(docs)/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function Page(props: PageProps<'/[[...slug]]'>) {

return (
<DocsPage toc={page.data.toc} full={page.data.full ?? false}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsTitle className="fd-title">{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX
Expand All @@ -41,11 +41,12 @@ export async function generateMetadata(props: PageProps<'/[[...slug]]'>): Promis
/* Every docs page gets its own generated card from app/og/[...slug]. The
home page is the exception: it is the one the estate links to, and it has
a hand-built card of its own in the root layout. Overriding it here would
replace that card with the generic template. */
replace that card with the generic template. Its title is the site's name,
so it skips the "%s | Primitives.org.ai" template rather than repeat it. */
const isHome = (params.slug ?? []).length === 0

return {
title: page.data.title,
title: isHome ? { absolute: page.data.title } : page.data.title,
description: page.data.description,
...(isHome ? {} : { openGraph: { images: getPageImage(page).url } }),
}
Expand Down
Binary file added site/app/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/app/favicon.ico
Binary file not shown.
93 changes: 93 additions & 0 deletions site/app/fonts/publicsans-OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans) PublicSans-Italic[wght].ttf: Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added site/app/fonts/publicsans-latin.woff2
Binary file not shown.
49 changes: 49 additions & 0 deletions site/app/global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';

/* The Org.AI Foundation's palette, as foundation.org.ai defines it. Fumadocs 16 takes full colour values, so the
Foundation's own oklch tokens are used as they are (named on the right). The docs are dark, as every Foundation site
is, so the light and dark sets are the same; the sidebar, which Fumadocs tints apart, takes the same. */
:root,
.dark,
.dark #nd-sidebar {
--color-fd-background: oklch(0.178 0.006 78); /* ground */
--color-fd-foreground: oklch(0.96 0.005 86); /* ink */
--color-fd-muted: oklch(0.222 0.007 78); /* raise */
--color-fd-muted-foreground: oklch(0.67 0.006 82); /* ink-3 */
--color-fd-popover: oklch(0.222 0.007 78); /* raise */
--color-fd-popover-foreground: oklch(0.96 0.005 86); /* ink */
--color-fd-card: oklch(0.222 0.007 78); /* raise */
--color-fd-card-foreground: oklch(0.96 0.005 86); /* ink */
--color-fd-border: oklch(0.26 0.007 78); /* rule-faint */
--color-fd-primary: oklch(0.8 0.118 68); /* now, the amber */
--color-fd-primary-foreground: oklch(0.21 0.03 62); /* now-ink */
--color-fd-secondary: oklch(0.222 0.007 78); /* raise */
--color-fd-secondary-foreground: oklch(0.96 0.005 86); /* ink */
--color-fd-accent: oklch(0.27 0.008 78); /* raise-hi */
--color-fd-accent-foreground: oklch(0.96 0.005 86); /* ink */
--color-fd-ring: oklch(0.8 0.118 68); /* now */
--color-fd-overlay: oklch(
0.12 0.005 78 / 0.62
); /* the dim behind a sheet, as on foundation.org.ai */
color-scheme: dark;
}

/* the Foundation's type: headings set light, with tight tracking, as on foundation.org.ai */
.fd-title {
font-weight: 360;
letter-spacing: -0.025em;
}
.prose h1 {
font-weight: 340;
letter-spacing: -0.03em;
}
.prose h2 {
font-weight: 400;
letter-spacing: -0.02em;
}
.prose h3 {
font-weight: 500;
letter-spacing: -0.012em;
}
.prose h4 {
font-weight: 600;
}
1 change: 1 addition & 0 deletions site/app/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions site/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { RootProvider } from 'fumadocs-ui/provider/next';
import './global.css';
import { Inter } from 'next/font/google';
const inter = Inter({
subsets: ['latin'],
});
import localFont from 'next/font/local';
// Public Sans, the Org.AI Foundation's typeface, served from this site
const publicSans = localFont({ src: './fonts/publicsans-latin.woff2', weight: '100 900', display: 'swap' });
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL
? new URL(process.env.NEXT_PUBLIC_BASE_URL)
: new URL('https://primitives.org.ai');
Expand Down Expand Up @@ -52,9 +51,10 @@ export const metadata = {
},
};
export default function Layout({ children }) {
return (<html lang="en" className={inter.className} suppressHydrationWarning>
return (<html lang="en" className={publicSans.className} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
{/* dark, as every Org.AI Foundation site is */}
<RootProvider theme={{ forcedTheme: 'dark', defaultTheme: 'dark', enableSystem: false }}>{children}</RootProvider>
</body>
</html>);
}
17 changes: 12 additions & 5 deletions site/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { RootProvider } from 'fumadocs-ui/provider/next'
import './global.css'
import { Inter } from 'next/font/google'
import type { Metadata } from 'next'

const inter = Inter({
subsets: ['latin'],
import localFont from 'next/font/local'

// Public Sans, the Org.AI Foundation's typeface, served from this site
const publicSans = localFont({
src: './fonts/publicsans-latin.woff2',
weight: '100 900',
display: 'swap',
})

const baseUrl = process.env['NEXT_PUBLIC_BASE_URL']
Expand Down Expand Up @@ -72,9 +76,12 @@ export const metadata: Metadata = {

export default function Layout({ children }: LayoutProps<'/'>) {
return (
<html lang="en" className={inter.className} suppressHydrationWarning>
<html lang="en" className={publicSans.className} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
{/* dark, as every Org.AI Foundation site is */}
<RootProvider theme={{ forcedTheme: 'dark', defaultTheme: 'dark', enableSystem: false }}>
{children}
</RootProvider>
<footer className="border-t border-fd-border px-6 py-6 text-sm text-fd-muted-foreground">
<p>
The primitives are documented by{' '}
Expand Down
3 changes: 0 additions & 3 deletions site/app/not-found.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ export default function NotFound() {
<Link href="/" className="inline-flex items-center gap-2 px-6 py-3 bg-fd-primary text-fd-primary-foreground rounded-lg font-medium hover:opacity-90 transition-opacity">
Go Home
</Link>
<Link href="/docs" className="inline-flex items-center gap-2 px-6 py-3 border border-fd-border rounded-lg font-medium hover:bg-fd-accent transition-colors">
Documentation
</Link>
</div>
</div>
</div>);
Expand Down
6 changes: 0 additions & 6 deletions site/app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ export default function NotFound() {
>
Go Home
</Link>
<Link
href="/docs"
className="inline-flex items-center gap-2 px-6 py-3 border border-fd-border rounded-lg font-medium hover:bg-fd-accent transition-colors"
>
Documentation
</Link>
</div>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions site/lib/layout.shared.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import Image from 'next/image';
import { OrgAiMark } from './org-ai-mark';
export function baseOptions() {
return {
nav: {
title: (<>
<Image src="/org-ai.svg" alt="" width={24} height={24}/>
<OrgAiMark />
Primitives.org.ai
</>),
},
githubUrl: 'https://github.com/dot-org-ai/primitives.org.ai',
// dark only, as every Org.AI Foundation site is: no light theme to switch to
themeSwitch: { enabled: false },
};
}
6 changes: 4 additions & 2 deletions site/lib/layout.shared.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import Image from 'next/image';
import { OrgAiMark } from './org-ai-mark';

export function baseOptions(): BaseLayoutProps {
return {
nav: {
title: (
<>
<Image src="/org-ai.svg" alt="" width={24} height={24} />
<OrgAiMark />
Primitives.org.ai
</>
),
Expand All @@ -17,5 +17,7 @@ export function baseOptions(): BaseLayoutProps {
{ text: 'The Org.AI Foundation', url: 'https://foundation.org.ai', external: true },
],
githubUrl: 'https://github.com/dot-org-ai/primitives.org.ai',
// dark only, as every Org.AI Foundation site is: no light theme to switch to
themeSwitch: { enabled: false },
};
}
55 changes: 55 additions & 0 deletions site/lib/org-ai-mark.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/** The Org.AI Foundation's mark: six ovals turning, the last one amber. The five take the text colour, so the mark follows the theme. */
export function OrgAiMark({ size = 24 }: { size?: number }) {
return (
<svg viewBox="0 0 48 48" width={size} height={size} aria-hidden="true" focusable="false">
<ellipse
cx="20.32"
cy="37.72"
rx="6.8"
ry="3.9"
transform="rotate(129 20.32 37.72)"
fill="currentColor"
/>
<ellipse
cx="10.28"
cy="27.68"
rx="6.8"
ry="3.9"
transform="rotate(189 10.28 27.68)"
fill="currentColor"
/>
<ellipse
cx="13.96"
cy="13.96"
rx="6.8"
ry="3.9"
transform="rotate(249 13.96 13.96)"
fill="currentColor"
/>
<ellipse
cx="27.68"
cy="10.28"
rx="6.8"
ry="3.9"
transform="rotate(309 27.68 10.28)"
fill="currentColor"
/>
<ellipse
cx="37.72"
cy="20.32"
rx="6.8"
ry="3.9"
transform="rotate(369 37.72 20.32)"
fill="currentColor"
/>
<ellipse
cx="34.04"
cy="34.04"
rx="6.8"
ry="3.9"
transform="rotate(429 34.04 34.04)"
fill="#f0af66"
/>
</svg>
)
}
Loading
Loading