full site update

This commit is contained in:
2025-07-24 18:46:24 +02:00
parent bfe2b90d8d
commit 37a6e0ab31
6912 changed files with 540482 additions and 361712 deletions

View File

@@ -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 {};

View File

@@ -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
};