-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
문서 페이지 레이아웃, /docs/ko/readme, 검색 인덱스 포팅 및 404 개선
- Loading branch information
Showing
30 changed files
with
956 additions
and
682 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { HttpStatusCode } from "@solidjs/start"; | ||
import { ErrorBoundary, type JSXElement } from "solid-js"; | ||
|
||
import portoneGradientBg from "~/assets/portone-gradient-bg.png?imagetools"; | ||
import portoneLogoWhite from "~/assets/portone-logo-white.png?imagetools"; | ||
|
||
import Picture from "./Picture"; | ||
|
||
export class NotFoundError extends Error { | ||
constructor() { | ||
super("Not Found"); | ||
this.name = "NotFoundError"; | ||
} | ||
} | ||
|
||
export function NotFoundBoundary(props: { children: JSXElement }) { | ||
return ( | ||
<ErrorBoundary | ||
fallback={(err) => { | ||
if (err instanceof Error && err.name === "NotFoundError") { | ||
return <NotFoundPage />; | ||
} | ||
throw err; | ||
}} | ||
> | ||
{props.children} | ||
</ErrorBoundary> | ||
); | ||
} | ||
|
||
function NotFoundPage() { | ||
return ( | ||
<> | ||
<HttpStatusCode code={404} /> | ||
<Picture | ||
picture={portoneGradientBg} | ||
alt="PortOne" | ||
class="absolute inset-0 h-full w-full object-cover object-center" | ||
/> | ||
<div class="relative h-full flex flex-col items-center justify-center gap-3xl text-white"> | ||
<div class="flex flex-col items-center gap-2.5"> | ||
<Picture picture={portoneLogoWhite} alt="PortOne" class="w-40" /> | ||
<span class="text-7xl font-bold tracking-[0.08em]">404</span> | ||
<span class="text-2xl tracking-[0.06em]"> | ||
페이지를 찾을 수 없습니다 | ||
</span> | ||
</div> | ||
<button | ||
class="flex items-center gap-1 border border-gray-300 rounded-md bg-[rgb(255_255_255_/_4%)] px-4 py-3 transition-colors active:bg-portone focus:bg-[rgb(255_255_255_/16%)] hover:bg-[rgb(255_255_255_/16%)] active:text-white focus:text-portone hover:text-portone" | ||
onClick={() => history.back()} | ||
> | ||
<i class="i-ic-baseline-arrow-back text-lg"></i> | ||
<span class="text-sm">뒤로 돌아가기</span> | ||
</button> | ||
</div> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { cache, createAsync } from "@solidjs/router"; | ||
import { createMemo, Show } from "solid-js"; | ||
|
||
interface Props { | ||
slug: string; | ||
} | ||
|
||
const getEntryData = cache(async (slug: string) => { | ||
"use server"; | ||
|
||
const { docs } = await import("#content"); | ||
return (docs as Record<string, (typeof docs)[keyof typeof docs]>)[slug] | ||
?.frontmatter; | ||
}, "docs/entry"); | ||
|
||
export default function ContentRef(props: Props) { | ||
const slug = createMemo(() => props.slug.slice(1)); | ||
const entryData = createAsync(() => getEntryData(slug())); | ||
const title = createMemo(() => entryData()?.title); | ||
|
||
return ( | ||
<Show when={title()}> | ||
<a class="m-4" href={`/docs/${slug()}`}> | ||
<div class="flex items-center justify-between gap-4 border rounded bg-white p-4 transition-transform hover:translate-y-[-2px] hover:text-orange-5 hover:drop-shadow-[0_12px_13px_rgba(0,0,0,0.02)]"> | ||
<span>{title()}</span> | ||
<i class="i-ic-baseline-chevron-right inline-block text-2xl" /> | ||
</div> | ||
</a> | ||
</Show> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,14 @@ | ||
import type React from "react"; | ||
import { type JSXElement, Show } from "solid-js"; | ||
|
||
import { useSystemVersion } from "#state/system-version"; | ||
import { useServerFallback } from "~/misc/useServerFallback"; | ||
import type { SystemVersion } from "~/type"; | ||
import { useSystemVersion } from "~/state/system-version"; | ||
|
||
interface Props { | ||
serverSystemVersion: SystemVersion; | ||
default?: SystemVersion; | ||
v1?: React.ReactNode; | ||
v2?: React.ReactNode; | ||
children?: React.ReactNode; | ||
v: "v1" | "v2"; | ||
children?: JSXElement; | ||
} | ||
|
||
const isEmptyStaticHtml = (node: React.ReactNode) => { | ||
if (!(node && typeof node === "object" && "props" in node)) return false; | ||
const props = node.props as unknown; | ||
|
||
return Boolean( | ||
props && | ||
typeof props === "object" && | ||
"value" in props && | ||
!JSON.parse(JSON.stringify(props.value)), | ||
); | ||
}; | ||
|
||
export default function VersionGate(props: Props) { | ||
const systemVersion = useServerFallback( | ||
useSystemVersion(), | ||
props.serverSystemVersion, | ||
); | ||
|
||
const hasV1 = !isEmptyStaticHtml(props.v1); | ||
const hasV2 = !isEmptyStaticHtml(props.v2); | ||
const v1 = hasV1 ? props.v1 : null; | ||
const v2 = hasV2 ? props.v2 : null; | ||
const { systemVersion } = useSystemVersion(); | ||
|
||
return ( | ||
<> | ||
{ | ||
{ | ||
v1: props.default === "v1" ? v1 ?? props.children : v1, | ||
v2: props.default === "v2" ? v2 ?? props.children : v2, | ||
}[systemVersion] | ||
} | ||
</> | ||
); | ||
return <Show when={systemVersion() === props.v}>{props.children}</Show>; | ||
} |
Oops, something went wrong.