Title on errorpage

This commit is contained in:
Daniel Kluge 2022-10-20 17:53:28 +02:00
parent 4953da3aee
commit e54ccb0c59
2 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,5 @@
import type { NextPage } from "next"; import type { NextPage } from "next";
import Head from "next/head";
import Link from "next/link"; import Link from "next/link";
import styles from "../styles/Errorpage.module.css"; import styles from "../styles/Errorpage.module.css";
@ -64,7 +65,9 @@ const svg = `
`; `;
const Custom404: NextPage = () => { const Custom404: NextPage = () => {
return <div className={styles.container}> return <>
<Head><title>Error 404 - c0ntroller.de</title></Head>
<div className={styles.container}>
<div id={styles.wrapper}> <div id={styles.wrapper}>
<div id={styles.box} dangerouslySetInnerHTML={{__html: svg}}> <div id={styles.box} dangerouslySetInnerHTML={{__html: svg}}>
</div> </div>
@ -73,7 +76,7 @@ const Custom404: NextPage = () => {
<Link href="/"><a>&gt; Back to the main page &lt;</a></Link> <Link href="/"><a>&gt; Back to the main page &lt;</a></Link>
</div> </div>
</div> </div>
</div>; </div></>;
}; };
export default Custom404; export default Custom404;

View File

@ -1,4 +1,5 @@
import { NextPage, NextPageContext } from "next"; import { NextPage, NextPageContext } from "next";
import Head from "next/head";
import Link from "next/link"; import Link from "next/link";
import styles from "../styles/Errorpage.module.css"; import styles from "../styles/Errorpage.module.css";
@ -64,7 +65,9 @@ const Error: NextPage<{ statusCode?: number }> = ({ statusCode }) => {
</svg> </svg>
`; `;
return <div className={styles.container}> return <>
<Head><title>Error {statusCode} - c0ntroller.de</title></Head>
<div className={styles.container}>
<div id={styles.wrapper}> <div id={styles.wrapper}>
<div id={styles.box} dangerouslySetInnerHTML={{ __html: svg }}> <div id={styles.box} dangerouslySetInnerHTML={{ __html: svg }}>
</div> </div>
@ -74,7 +77,7 @@ const Error: NextPage<{ statusCode?: number }> = ({ statusCode }) => {
<Link href="/"><a>&gt; Back to the main page &lt;</a></Link> <Link href="/"><a>&gt; Back to the main page &lt;</a></Link>
</div> </div>
</div> </div>
</div>; </div></>;
}; };
Error.getInitialProps = ({ res, err }: NextPageContext) => { Error.getInitialProps = ({ res, err }: NextPageContext) => {