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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
/.build
/.pnpm-store/
/Packages
xcuserdata/
DerivedData/
Expand Down
3 changes: 3 additions & 0 deletions docs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@photon-hq:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_TOKEN}
always-auth=true
23 changes: 23 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@ This is a Next.js application generated with

It is a Next.js app with [Static Export](https://nextjs.org/docs/app/guides/static-exports) configured.

## Shared Photon theme

The reusable Fumadocs presentation layer is published as
[`@photon-hq/fumadocs-theme`](https://github.com/orgs/photon-hq/packages/npm/package/fumadocs-theme),
an internal GitHub Package.
Set `GITHUB_PACKAGES_TOKEN` to a classic GitHub personal access token with
`read:packages` before installing dependencies locally or in an external build
environment such as Cloudflare:

```bash
pnpm install --frozen-lockfile
```

The committed `.npmrc` maps the `@photon-hq` scope to GitHub Packages and reads
the token from the environment; it does not contain a credential. If the Photon
organization enforces SAML SSO, authorize the token for the organization.
Configure the same value as an encrypted `GITHUB_PACKAGES_TOKEN` build secret
in Cloudflare; prefer a service-account token limited to `read:packages`.

Astrolabe keeps its content, logo, font registration, routes, and deployment
configuration here; shared layout, provider, search, page actions, and styling
come from the version pinned in `package.json`.

Run development server:

```bash
Expand Down
37 changes: 17 additions & 20 deletions docs/app/(docs)/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ import {
} from '@/lib/source';
import {
DocsBody,
DocsDescription,
DocsPage,
DocsTitle,
} from 'fumadocs-ui/layouts/docs/page';
import { notFound } from 'next/navigation';
import { getMDXComponents } from '@/components/mdx';
import type { Metadata } from 'next';
import { createRelativeLink } from 'fumadocs-ui/mdx';
import { gitConfig } from '@/lib/shared';
import { gitConfig, withDocsBasePath } from '@/lib/shared';
import { findNeighbour } from 'fumadocs-core/page-tree';
import { DocsPageActions } from '@/components/docs-page-actions';
import { PhotonDocsPageHeader } from '@photon-hq/fumadocs-theme/page';
import { PhotonDocsPageActions } from '@photon-hq/fumadocs-theme/page-actions';

export default async function Page(props: PageProps<'/[[...slug]]'>) {
const params = await props.params;
Expand Down Expand Up @@ -47,22 +46,20 @@ export default async function Page(props: PageProps<'/[[...slug]]'>) {

return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<div className="astrolabe-docs-header">
<div className="astrolabe-docs-heading">
<DocsTitle className="astrolabe-docs-title">{page.data.title}</DocsTitle>
<DocsDescription className="astrolabe-docs-description">
{page.data.description}
</DocsDescription>
</div>
<DocsPageActions
pageText={pageText}
pageUrl={page.url}
markdownUrl={markdownUrl}
githubUrl={githubUrl}
previous={previousPage}
next={nextPage}
/>
</div>
<PhotonDocsPageHeader
title={page.data.title}
description={page.data.description}
actions={
<PhotonDocsPageActions
pageText={pageText}
pageUrl={withDocsBasePath(page.url)}
markdownUrl={markdownUrl}
sourceUrl={githubUrl}
previous={previousPage}
next={nextPage}
/>
}
/>
<DocsBody>
<MDX
components={getMDXComponents({
Expand Down
9 changes: 7 additions & 2 deletions docs/app/(docs)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/lib/layout.shared';
import { SidebarActions } from '@/components/sidebar-actions';
import { PhotonSidebarActions } from '@photon-hq/fumadocs-theme/sidebar';
import { gitConfig } from '@/lib/shared';

export default function Layout({ children }: LayoutProps<'/'>) {
return (
Expand All @@ -12,7 +13,11 @@ export default function Layout({ children }: LayoutProps<'/'>) {
sidebar={{
collapsible: true,
defaultOpenLevel: 1,
footer: <SidebarActions />,
footer: (
<PhotonSidebarActions
repositoryUrl={`https://github.com/${gitConfig.user}/${gitConfig.repo}`}
/>
),
}}
>
{children}
Expand Down
Loading