2024-02-05 11:57:10 +07:00
|
|
|
import { i18n } from "../../i18n"
|
2024-02-26 07:58:21 +07:00
|
|
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
|
2023-09-07 11:02:21 +07:00
|
|
|
|
2024-02-26 07:58:21 +07:00
|
|
|
const NotFound: QuartzComponent = ({ cfg }: QuartzComponentProps) => {
|
2024-05-23 03:44:54 +07:00
|
|
|
// 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
|
|
|
|
|
2023-09-07 11:02:21 +07:00
|
|
|
return (
|
|
|
|
<article class="popover-hint">
|
|
|
|
<h1>404</h1>
|
2024-02-05 11:57:10 +07:00
|
|
|
<p>{i18n(cfg.locale).pages.error.notFound}</p>
|
2024-05-23 03:44:54 +07:00
|
|
|
<a href={baseDir}>{i18n(cfg.locale).pages.error.home}</a>
|
2023-09-07 11:02:21 +07:00
|
|
|
</article>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default (() => NotFound) satisfies QuartzComponentConstructor
|