4xx.ts — astro Source File
Architecture documentation for 4xx.ts, a typescript file in the astro codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 290d338a_b86f_3c08_2047_f178684bb43d["4xx.ts"] e4df8f29_fb2f_3d70_a962_fdf6a3670b22["path"] 290d338a_b86f_3c08_2047_f178684bb43d --> e4df8f29_fb2f_3d70_a962_fdf6a3670b22 fc634da7_3e72_de83_7395_a46311dd837e["html-escaper"] 290d338a_b86f_3c08_2047_f178684bb43d --> fc634da7_3e72_de83_7395_a46311dd837e style 290d338a_b86f_3c08_2047_f178684bb43d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { appendForwardSlash, removeTrailingForwardSlash } from '@astrojs/internal-helpers/path';
import { escape } from 'html-escaper';
interface ErrorTemplateOptions {
/** a short description of the error */
pathname: string;
/** HTTP error code */
statusCode?: number;
/** HTML <title> */
tabTitle: string;
/** page title */
title: string;
/** The body of the message, if one is provided */
body?: string;
}
/** Display all errors */
export default function template({
title,
pathname,
statusCode = 404,
tabTitle,
body,
}: ErrorTemplateOptions): string {
return `<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>${tabTitle}</title>
<style>
:root {
--gray-10: hsl(258, 7%, 10%);
--gray-20: hsl(258, 7%, 20%);
--gray-30: hsl(258, 7%, 30%);
--gray-40: hsl(258, 7%, 40%);
--gray-50: hsl(258, 7%, 50%);
--gray-60: hsl(258, 7%, 60%);
--gray-70: hsl(258, 7%, 70%);
--gray-80: hsl(258, 7%, 80%);
--gray-90: hsl(258, 7%, 90%);
--black: #13151A;
--accent-light: #E0CCFA;
}
* {
box-sizing: border-box;
}
html {
background: var(--black);
color-scheme: dark;
accent-color: var(--accent-light);
}
body {
background-color: var(--gray-10);
color: var(--gray-80);
font-family: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
line-height: 1.5;
margin: 0;
// ... (100 more lines)
Domain
Subdomains
Types
Dependencies
- html-escaper
- path
Source
Frequently Asked Questions
What does 4xx.ts do?
4xx.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in 4xx.ts?
4xx.ts defines 4 function(s): notFoundTemplate, subpathNotUsedTemplate, template, trailingSlashMismatchTemplate.
What does 4xx.ts depend on?
4xx.ts imports 2 module(s): html-escaper, path.
Where is 4xx.ts in the architecture?
4xx.ts is located at packages/astro/src/template/4xx.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/template).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free