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
16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

3 changes: 1 addition & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"singleQuote": true,
"trailingComma": "none",
"plugins": ["prettier-plugin-tailwindcss"],
"tailwindConfig": "./tailwind.config.js"
"plugins": ["prettier-plugin-tailwindcss"]
}
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{}
{
"files.associations": {
"*.css": "tailwindcss"
}
}
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,3 @@ install node, it is recommended to follow the guide provided by Node.js

For comprehensive guidelines on writing documentation, including how to use custom nodes and tags, please refer to the
[Writing Documentation](/WRITING_DOCS.md) page.

## Generating a PDF

This repository provides a tool for generating a PDFs from the documentation using [puppeteer](https://pptr.dev).
To run the tool, use the following commands:

```bash
cd tools/pdf
npm install
npm run generate-pdf
```
12 changes: 10 additions & 2 deletions app/[...slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
// Copyright (c) ZeroC, Inc.

import { PathProvider } from 'context/state';
import { ReactNode } from 'react';

export default function DocsLayout(props: any) {
const path = '/' + (props.params.slug?.join('/') ?? '');
interface DocsLayoutProps {
children: ReactNode;
params: Promise<{
slug?: string[];
}>;
}

export default async function DocsLayout(props: DocsLayoutProps) {
const path = '/' + ((await props.params).slug?.join('/') ?? '');
return <PathProvider path={path}>{props.children}</PathProvider>;
}
15 changes: 8 additions & 7 deletions app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ type PageProps = {
params: Params;
};

export async function generateMetadata({
params
}: PageProps): Promise<Metadata> {
export async function generateMetadata(props: PageProps): Promise<Metadata> {
const params = await props.params;
const path = '/' + (params.slug.join('/') ?? '');
const { frontmatter } = await getMarkdownContent(path);
const title: string = frontmatter?.title ?? '';
Expand All @@ -38,8 +37,9 @@ export async function generateMetadata({
title,
description,
images: {
url: `https://docs.icerpc.dev/api/og?title=${baseUrls.includes(path) ? 'Overview' : title
}&description=${description}&path=${encodeURIComponent(path)}`
url: `https://docs.icerpc.dev/api/og?title=${
baseUrls.includes(path) ? 'Overview' : title
}&description=${description}&path=${encodeURIComponent(path)}`
}
}
};
Expand Down Expand Up @@ -90,7 +90,8 @@ export async function generateStaticParams() {
}));
}

export default async function Page({ params }: PageProps) {
export default async function Page(props: PageProps) {
const params = await props.params;
const path = '/' + (params.slug.join('/') ?? '');
const { content } = await getMarkdownContent(path);

Expand All @@ -104,7 +105,7 @@ export default async function Page({ params }: PageProps) {

return (
<div className="mt-[6.4rem] flex grow flex-row justify-center">
<div className="flex max-w-[100rem] grow flex-row justify-center">
<div className="flex max-w-400 grow flex-row justify-center">
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class name max-w-400 is invalid. Should be max-w-[100rem] (original value).

Copilot uses AI. Check for mistakes.
<SideNav path={path} />
<div className="grow">
<div id="skip-nav" />
Expand Down
125 changes: 60 additions & 65 deletions app/api/og/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export async function GET(request: NextRequest) {
: pageImage(hostname, breadcrumbs, title, description);

return image;
} catch (e: any) {
console.log(`${e.message}`);
} catch (e) {
console.log(`${e instanceof Error ? e.message : 'Unknown error'}`);
return new NextResponse(`Failed to generate the image`, {
status: 500
});
Expand All @@ -39,20 +39,18 @@ export async function GET(request: NextRequest) {
// Image rendering functions
const homeImage = (hostname: string | null) => {
return new ImageResponse(
(
<div
style={{
background: 'black',
height: '100%',
width: '100%',
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
backgroundImage: `url(http://${hostname}/images/og-home.png)`,
backgroundSize: 'cover'
}}
/>
),
<div
style={{
background: 'black',
height: '100%',
width: '100%',
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
backgroundImage: `url(http://${hostname}/images/og-home.png)`,
backgroundSize: 'cover'
}}
/>,
{
width: 1200,
height: 630
Expand All @@ -67,68 +65,65 @@ const pageImage = (
description: string | undefined
) => {
return new ImageResponse(
(
<div
style={{
background: 'black',
height: '100%',
width: '100%',
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
backgroundImage: `url(http://${hostname}/images/og.png)`,
backgroundSize: 'cover'
}}
>
<div
style={{
background: 'black',
height: '100%',
width: '100%',
width: '80%',
height: '360px',
marginTop: '200px',
marginLeft: '84px',
marginRight: '84px',
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
backgroundImage: `url(http://${hostname}/images/og.png)`,
backgroundSize: 'cover'
justifyContent: 'flex-start'
}}
>
<div
<ol
style={{
width: '80%',
height: '360px',
marginTop: '200px',
marginLeft: '84px',
marginRight: '84px',
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
justifyContent: 'flex-start'
justifyContent: 'flex-start',
padding: '0px'
}}
>
<ol
style={{
display: 'flex',
justifyContent: 'flex-start',
padding: '0px'
}}
>
{renderBreadcrumb(breadcrumbs)}
</ol>
<h1
style={{
fontSize: '78px',
fontWeight: 700,
lineHeight: '80px',
marginTop: '4px',
marginLeft: '-6px'
}}
>
{title}
</h1>
<h2
style={{
fontSize: '32px',
fontWeight: '600',
color: '#64748b',
maxWidth: '80%',
lineHeight: '42px'
}}
>
{description}
</h2>
</div>
{renderBreadcrumb(breadcrumbs)}
</ol>
<h1
style={{
fontSize: '78px',
fontWeight: 700,
lineHeight: '80px',
marginTop: '4px',
marginLeft: '-6px'
}}
>
{title}
</h1>
<h2
style={{
fontSize: '32px',
fontWeight: '600',
color: '#64748b',
maxWidth: '80%',
lineHeight: '42px'
}}
>
{description}
</h2>
</div>
),
</div>,
{
// @ts-ignore - The FontOptions type cannot be imported
width: 1200,
height: 630
}
Expand Down
Loading