full site update
This commit is contained in:
1
node_modules/astro/dist/template/4xx.d.ts
generated
vendored
1
node_modules/astro/dist/template/4xx.d.ts
generated
vendored
@@ -13,5 +13,6 @@ interface ErrorTemplateOptions {
|
||||
/** Display all errors */
|
||||
export default function template({ title, pathname, statusCode, tabTitle, body, }: ErrorTemplateOptions): string;
|
||||
export declare function subpathNotUsedTemplate(base: string, pathname: string): string;
|
||||
export declare function trailingSlashMismatchTemplate(pathname: string, trailingSlash: 'always' | 'never' | 'ignore'): string;
|
||||
export declare function notFoundTemplate(pathname: string, message?: string): string;
|
||||
export {};
|
||||
|
15
node_modules/astro/dist/template/4xx.js
generated
vendored
15
node_modules/astro/dist/template/4xx.js
generated
vendored
@@ -1,3 +1,4 @@
|
||||
import { appendForwardSlash, removeTrailingForwardSlash } from "@astrojs/internal-helpers/path";
|
||||
import { escape } from "html-escaper";
|
||||
function template({
|
||||
title,
|
||||
@@ -107,6 +108,17 @@ function subpathNotUsedTemplate(base, pathname) {
|
||||
<p>Come to our <a href="https://astro.build/chat">Discord</a> if you need help.</p>`
|
||||
});
|
||||
}
|
||||
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: `<p>Your site is configured with <code>trailingSlash</code> set to <code>${trailingSlash}</code>. Do you want to go to <a href="${corrected}">${corrected}</a> instead?</p>
|
||||
<p>See <a href="https://docs.astro.build/en/reference/configuration-reference/#trailingslash">the documentation for <code>trailingSlash</code></a> if you need help.</p>`
|
||||
});
|
||||
}
|
||||
function notFoundTemplate(pathname, message = "Not found") {
|
||||
return template({
|
||||
pathname,
|
||||
@@ -118,5 +130,6 @@ function notFoundTemplate(pathname, message = "Not found") {
|
||||
export {
|
||||
template as default,
|
||||
notFoundTemplate,
|
||||
subpathNotUsedTemplate
|
||||
subpathNotUsedTemplate,
|
||||
trailingSlashMismatchTemplate
|
||||
};
|
||||
|
Reference in New Issue
Block a user