Skip to content

Commit

Permalink
퀵 가이드 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
CirnoV committed Oct 29, 2024
1 parent 6eabf9c commit aac78c3
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const DocsEntry = z.object({
description: z.string(),
targetVersions: z.array(SystemVersion).optional(),
versionVariants: z.record(SystemVersion, z.string()).optional(),
rightSidebar: z.boolean().optional().default(true),
});
export type DocsEntry = z.infer<typeof DocsEntry>;

Expand Down
14 changes: 9 additions & 5 deletions src/layouts/docs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,18 @@ export function Docs(props: { children: JSXElement }) {
</div>
{props.children}
</article>
<div id="docs-right-sidebar">
<Show when={frontmatter().rightSidebar}>
<RightSidebar
lang={params().lang}
file={doc()?.file ?? ""}
headings={doc()?.headings ?? []}
/>
</Show>
</div>
</>
)}
</Show>
<RightSidebar
lang={params().lang}
file={doc()?.file ?? ""}
headings={doc()?.headings ?? []}
/>
</div>
</>
)}
Expand Down
17 changes: 17 additions & 0 deletions src/layouts/sidebar/CodePreview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { type JSXElement } from "solid-js";
import { Portal } from "solid-js/web";

interface Props {
children?: JSXElement;
}

export default function CodePreview(props: Props) {
return (
<>
<div>{props.children}</div>
<Portal mount={document.getElementById("docs-right-sidebar")!}>
<div class="w-133">test</div>
</Portal>
</>
);
}
1 change: 1 addition & 0 deletions src/routes/(root)/opi/ko/_nav.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- label: 결제 연동하기
systemVersion: v2
items:
- /ko/quick-guide/payment
- /ko/integration/ready/readme
- slug: /ko/integration/start/v2/readme
items:
Expand Down
11 changes: 11 additions & 0 deletions src/routes/(root)/opi/ko/quick-guide/payment.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: 퀵 가이드
description: 결제연동 퀵 가이드
rightSidebar: false
---

import CodePreview from '~/layouts/sidebar/CodePreview';

<CodePreview>
test
</CodePreview>

0 comments on commit aac78c3

Please sign in to comment.