Files
Code-Notes/quartz/components/pages/404.tsx
Oyasumi Gitea 4a5acab07d
All checks were successful
Build and Deploy Quartz / build-and-deploy (push) Has been skipped
init: init commit
2026-01-01 14:16:34 +08:00

19 lines
649 B
TypeScript

import { i18n } from "../../i18n"
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
const NotFound: QuartzComponent = ({ cfg }: QuartzComponentProps) => {
// If baseUrl contains a pathname after the domain, use this as the home link
const url = new URL(`https://${cfg.baseUrl ?? "example.com"}`)
const baseDir = url.pathname
return (
<article class="popover-hint">
<h1>404</h1>
<p>{i18n(cfg.locale).pages.error.notFound}</p>
<a href={baseDir}>{i18n(cfg.locale).pages.error.home}</a>
</article>
)
}
export default (() => NotFound) satisfies QuartzComponentConstructor