import { appendForwardSlash, removeTrailingForwardSlash } from "@astrojs/internal-helpers/path"; import { escape } from "html-escaper"; function template({ title, pathname, statusCode = 404, tabTitle, body }) { return ` ${tabTitle}

${statusCode ? `${statusCode}: ` : ""}${title}

${body || `
Path: ${escape(pathname)}
`}
`; } function subpathNotUsedTemplate(base, pathname) { return template({ pathname, statusCode: 404, title: "Not found", tabTitle: "404: Not Found", body: `

In your site you have your base path set to ${base}. Do you want to go there instead?

Come to our Discord if you need help.

` }); } function trailingSlashMismatchTemplate(pathname, trailingSlash) { const corrected = trailingSlash === "always" ? appendForwardSlash(pathname) : removeTrailingForwardSlash(pathname); return template({ pathname, statusCode: 404, title: "Not found", tabTitle: "404: Not Found", body: `

Your site is configured with trailingSlash set to ${trailingSlash}. Do you want to go to ${corrected} instead?

See the documentation for trailingSlash if you need help.

` }); } function notFoundTemplate(pathname, message = "Not found") { return template({ pathname, statusCode: 404, title: message, tabTitle: `404: ${message}` }); } export { template as default, notFoundTemplate, subpathNotUsedTemplate, trailingSlashMismatchTemplate };