just link home on error page instead of showing full navbar

This commit is contained in:
Iris Lightshard 2022-06-16 23:19:50 -06:00
parent 85fcd94bfa
commit ae1606081f
Signed by: nilix
GPG key ID: 3B7FBC22144E6398
2 changed files with 19 additions and 1 deletions

View file

@ -41,7 +41,7 @@ func main() {
}, },
Fallback: *template.Must(template.ParseFiles( Fallback: *template.Must(template.ParseFiles(
pathConcat(templateRoot, "error.html"), pathConcat(templateRoot, "error.html"),
pathConcat(templateRoot, "header.html"), pathConcat(templateRoot, "header_err.html"),
pathConcat(templateRoot, "footer.html"))), pathConcat(templateRoot, "footer.html"))),
} }

18
templates/header_err.html Normal file
View file

@ -0,0 +1,18 @@
{{define "header"}}
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='description' content='Nirvash CMS'/>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link rel='stylesheet' type='text/css' href='/static/style.css'>
<title>Nirvash &mdash; CMS</title>
</head>
<body>
<header><h1>Nirvash CMS</h1></header>
<nav>
<ul>
<li><a href="/">Go home</a></li>
</ul>
</nav>
{{end}}