trailingSlashMismatchTemplate() — astro Function Reference
Architecture documentation for the trailingSlashMismatchTemplate() function in 4xx.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 999d15d6_67fd_38a9_4a32_1e26631a95c4["trailingSlashMismatchTemplate()"] 290d338a_b86f_3c08_2047_f178684bb43d["4xx.ts"] 999d15d6_67fd_38a9_4a32_1e26631a95c4 -->|defined in| 290d338a_b86f_3c08_2047_f178684bb43d 91253924_739f_881f_85ec_9ccad58d1384["template()"] 999d15d6_67fd_38a9_4a32_1e26631a95c4 -->|calls| 91253924_739f_881f_85ec_9ccad58d1384 style 999d15d6_67fd_38a9_4a32_1e26631a95c4 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/template/4xx.ts lines 133–150
export function trailingSlashMismatchTemplate(
pathname: string,
trailingSlash: 'always' | 'never' | 'ignore',
) {
const corrected = escape(
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>`,
});
}
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does trailingSlashMismatchTemplate() do?
trailingSlashMismatchTemplate() is a function in the astro codebase, defined in packages/astro/src/template/4xx.ts.
Where is trailingSlashMismatchTemplate() defined?
trailingSlashMismatchTemplate() is defined in packages/astro/src/template/4xx.ts at line 133.
What does trailingSlashMismatchTemplate() call?
trailingSlashMismatchTemplate() calls 1 function(s): template.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free