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
Expand Up @@ -32,6 +32,7 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
!scripts/.env.publish-image.example

# vercel
.vercel
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Documentation site for [Cube AI](https://github.com/ultravioletrs/cube), served

Built with [Next.js](https://nextjs.org) and [Fumadocs](https://fumadocs.dev), deployed to Cloudflare Workers as a static export nested under `/docs/cube-ai/`.

Images are served from a shared Cloudflare R2 bucket rather than committed to the repo —
see [`scripts/README.md`](./scripts/README.md).

## Development

```bash
Expand Down Expand Up @@ -49,18 +52,22 @@ lib/
metadata.ts # createMetadata helper
source.ts # Fumadocs source loader
public/
img/ # Images referenced by docs
_headers # Cloudflare cache headers
_redirects # Cloudflare redirects
robots.txt
scripts/
nest-static-export.mjs # Post-build: nest out/ under docs/cube-ai/
wrangler.jsonc # Cloudflare Workers config
publish-image.mjs # Maintainer-only: upload an image to R2 + purge cache
worker/
index.ts # Cloudflare Worker (main): serves /img/... from R2, else static assets
r2-proxy.ts # Shared R2 lookup + streaming logic
wrangler.jsonc # Cloudflare Workers config (assets + Worker + R2 binding)
biome.json # Linter / formatter (Biome)
```

## Tooling

- **Linter / Formatter**: [Biome](https://biomejs.dev)
- **Deployment**: Cloudflare Workers (static assets via `wrangler deploy`)
- **Deployment**: Cloudflare Workers (static assets + a small Worker for the R2-backed
image route, via `wrangler deploy`)
- **CI**: GitHub Actions — lint → type check → build
39 changes: 29 additions & 10 deletions mdx-components.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
import { ImageZoom } from "fumadocs-ui/components/image-zoom";
import defaultMdxComponents from "fumadocs-ui/mdx";
import type { MDXComponents } from "mdx/types";
import type { ComponentPropsWithoutRef, ReactNode } from "react";
import type { ComponentPropsWithoutRef } from "react";
import { Mermaid } from "@/components/mdx/mermaid";
import { assetPath } from "@/lib/base-path";
import { cn } from "@/lib/utils";

const DefaultImage = defaultMdxComponents.img as
| ((props: ComponentPropsWithoutRef<"img">) => ReactNode)
| undefined;

// Doc content images (content/docs/**/*.mdx) are served from the shared
// Cloudflare R2 bucket, not committed to this repo (see scripts/README.md),
// so fumadocs-mdx's static-import-based width/height inference is disabled
// (source.config.ts: remarkImageOptions: false) - it requires the file on
// disk at build time, which doesn't hold here. Rendered as a plain,
// zoomable <img> -- no next/image, no width/height needed, so there's
// nothing to keep in sync when images change.
export function getMDXComponents(components?: MDXComponents): MDXComponents {
return {
...defaultMdxComponents,
img: (props) => {
const src =
typeof props.src === "string" ? assetPath(props.src) : props.src;
img: (props: ComponentPropsWithoutRef<"img">) => {
const { src: rawSrc, alt, className } = props;
if (typeof rawSrc !== "string") return null;

const src = assetPath(rawSrc);

if (DefaultImage) return <DefaultImage {...props} src={src} />;
return null;
return (
// src/alt passed here too, not just to the inner <img>: ImageZoom's
// zoomed-in view reads its image from these props directly, not
// from `children`.
<ImageZoom src={src} alt={alt ?? ""}>
{/* biome-ignore lint/performance/noImgElement: doc content images are served from R2, not Next's image pipeline */}
<img
src={src}
alt={alt ?? ""}
loading="lazy"
className={cn("rounded-lg", className)}
/>
</ImageZoom>
);
},
Mermaid,
...components,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"lint": "biome check",
"format": "biome format --write",
"lint:fix": "biome check --write",
"lint:md": "markdownlint --disable MD013 MD033 MD007 MD029 MD059 MD024 MD025 -- content/docs"
"lint:md": "markdownlint --disable MD013 MD033 MD007 MD029 MD059 MD024 MD025 -- content/docs",
"publish-image": "node scripts/publish-image.mjs"
},
"dependencies": {
"@orama/orama": "^3.1.18",
Expand Down
Binary file removed public/img/attestation-policy-ui.png
Binary file not shown.
Binary file removed public/img/attestation-report-ui.png
Binary file not shown.
Binary file removed public/img/buildroot-cube-agent-config.png
Binary file not shown.
Binary file removed public/img/buildroot-cube-ai-services-menu.png
Binary file not shown.
Binary file removed public/img/buildroot-llm-backend-selection.png
Binary file not shown.
Binary file removed public/img/buildroot-llm-custom-url.png
Binary file not shown.
Binary file removed public/img/buildroot-ollama-custom-models.png
Binary file not shown.
Binary file removed public/img/chat-sidebar.png
Binary file not shown.
Binary file removed public/img/chat-ui.png
Binary file not shown.
Binary file removed public/img/continue-chat.png
Binary file not shown.
Binary file removed public/img/continue-config.png
Binary file not shown.
Binary file removed public/img/continue-marketplace.png
Binary file not shown.
Binary file removed public/img/cube-ai-architecture.png
Binary file not shown.
Binary file removed public/img/cube-ai-auth-flow.png
Binary file not shown.
Binary file removed public/img/cube-vllm-flow.png
Binary file not shown.
Binary file removed public/img/getting-started-chat.png
Binary file not shown.
Binary file removed public/img/getting-started-create-domain.png
Binary file not shown.
Binary file removed public/img/getting-started-login.png
Binary file not shown.
1 change: 0 additions & 1 deletion public/img/logos/altLogo.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/img/logos/sidebarLogo.svg

This file was deleted.

Binary file removed public/img/model-selector.png
Binary file not shown.
Binary file removed public/img/models-registry.png
Binary file not shown.
Binary file removed public/img/translations-flow.png
Binary file not shown.
Binary file removed public/img/ui/accept-invite.png
Binary file not shown.
Binary file removed public/img/ui/assign-user.png
Binary file not shown.
Binary file removed public/img/ui/audit-logs.png
Diff not rendered.
Binary file removed public/img/ui/audit-tee-attestation-details.png
Diff not rendered.
Binary file removed public/img/ui/audit-tee-attestation.png
Diff not rendered.
Binary file removed public/img/ui/change-password.png
Diff not rendered.
Binary file removed public/img/ui/chat.png
Diff not rendered.
Binary file removed public/img/ui/create-role.png
Diff not rendered.
Binary file removed public/img/ui/domain-members-roles.png
Diff not rendered.
Binary file removed public/img/ui/domains.png
Diff not rendered.
Binary file removed public/img/ui/forgot-password.png
Diff not rendered.
Binary file removed public/img/ui/guardrails-audit-logs-requests.png
Diff not rendered.
Binary file removed public/img/ui/guardrails-chat-allowed.png
Diff not rendered.
Binary file removed public/img/ui/guardrails-chat-blocked.png
Diff not rendered.
Binary file removed public/img/ui/guardrails-chat-restricted.png
Diff not rendered.
Binary file removed public/img/ui/guardrails-config.png
Diff not rendered.
Binary file removed public/img/ui/guardrails-create.png
Diff not rendered.
Binary file removed public/img/ui/guardrails-list.png
Diff not rendered.
Binary file removed public/img/ui/guardrails-version.png
Diff not rendered.
Binary file removed public/img/ui/guardrails.png
Diff not rendered.
Binary file removed public/img/ui/invitations.png
Diff not rendered.
Binary file removed public/img/ui/invite-member.png
Diff not rendered.
Binary file removed public/img/ui/login.png
Diff not rendered.
Binary file removed public/img/ui/members.png
Diff not rendered.
Binary file removed public/img/ui/models.png
Diff not rendered.
Binary file removed public/img/ui/pats-add-scope.png
Diff not rendered.
Binary file removed public/img/ui/pats-create-dialog.png
Diff not rendered.
Binary file removed public/img/ui/pats-list.png
Diff not rendered.
Binary file removed public/img/ui/pats-revoke-confirmation.png
Diff not rendered.
Binary file removed public/img/ui/profile-page.png
Diff not rendered.
Binary file removed public/img/ui/profile-pats-menu.png
Diff not rendered.
Binary file removed public/img/ui/role-actions.png
Diff not rendered.
Binary file removed public/img/ui/role-details.png
Diff not rendered.
Binary file removed public/img/ui/roles.png
Diff not rendered.
Binary file removed public/img/ui/signup.png
Diff not rendered.
Binary file removed public/img/ui/user-menu-logout.png
Diff not rendered.
Binary file removed public/img/vllm-architecture.png
Diff not rendered.
10 changes: 10 additions & 0 deletions scripts/.env.publish-image.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copy to scripts/.env.publish-image (gitignored) and fill in the token.
# Create the token under My Profile -> API Tokens -> Create Token -> Custom Token, with:
# - Workers R2 Storage: Edit
# - Zone -> Cache Purge -> Purge (scoped to the ultraviolet.rs zone)
CLOUDFLARE_API_TOKEN=

# Not secret - the ultraviolet.rs zone ID. Confirmed via a live Cloudflare
# API lookup while migrating the sibling ultraviolet/website repo; reused
# here since this site is served under the same domain/zone.
CLOUDFLARE_ZONE_ID=cbb18a791e53fb24efbeb169e48634df
Loading
Loading