html: fix headers

go's html/template was thinking header.html and other template snippets
were full documents, so inserting their own <html> and other tags,
breaking the head up. Renaming to txt seems to fix things.
This commit is contained in:
Harvey Tindall
2025-12-10 20:20:16 +00:00
parent 1c755306f9
commit 85a6d66228
11 changed files with 13 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
<title>404 - jfa-go</title>
{{ template "header.html" . }}
{{ template "header.txt" . }}
</head>
<body class="section">
<div class="page-container m-2 lg:my-20 lg:mx-64">

View File

@@ -1,7 +1,9 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "syntaxhighlighting.html" . }}
{{ template "syntaxhighlighting.txt" . }}
<title>Admin - jfa-go</title>
{{ template "header.txt" . }}
<script>
window.usernameEnabled = {{ .username }};
window.langFile = JSON.parse({{ .language }});
@@ -12,8 +14,6 @@
window.jfAllowAll = {{ .jfAllowAll }};
window.loginAppearance = "{{ .loginAppearance }}";
</script>
<title>Admin - jfa-go</title>
{{ template "header.html" . }}
</head>
<body class="max-w-full overflow-x-hidden section">
{{ template "login-modal.html" . }}
@@ -565,7 +565,7 @@
</form>
</div>
<div id="notification-box"></div>
<div class="page-container m-2 lg:my-20 lg:mx-64 flex flex-col gap-4">
<div class="page-container m-2 lg:my-20 lg:mx-64 flex flex-col gap-4 overflow-x-hidden">
<div class="top-2 inset-x-2 lg:absolute flex flex-row justify-between">
<div class="flex flex-row gap-2">
{{ template "lang-select.html" . }}
@@ -806,7 +806,7 @@
<span class="button ~info @low center unfocused " id="accounts-send-pwr">{{ .strings.sendPWR }}</span>
<span class="button ~critical @low center " id="accounts-delete-user">{{ .quantityStrings.deleteUser.Singular }}</span>
</div>
<div class="card @low accounts-header table-responsive">
<div class="card @low accounts-header overflow-x-scroll">
<table class="table text-base leading-5">
<thead>
<tr>

View File

@@ -3,7 +3,7 @@
<head>
<!--- This CSS is inlined so we should keep this here! -->
<link inline rel="stylesheet" type="text/css" href="web/css/v0.6.0bundle.css">
{{ template "header.html" . }}
{{ template "header.txt" . }}
<title>Crash report</title>
</head>
<body>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "header.html" . }}
{{ template "header.txt" . }}
<title>{{ .strings.successHeader }} - jfa-go</title>
</head>
<body class="section">

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "header.html" . }}
{{ template "header.txt" . }}
{{ if .passwordReset }}
<title>{{ .strings.passwordReset }}</title>
{{ else }}

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "header.html" . }}
{{ template "header.txt" . }}
<title>Invalid Code - jfa-go</title>
</head>
<body class="section">

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="{{ .cssClass }}">
<head>
{{ template "header.html" . }}
{{ template "header.txt" . }}
<title>{{ .strings.passwordReset }} - jfa-go</title>
</head>
<body class="section">

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="{{ .shortLang }}" dir="{{ .pageDirection }}" class="light">
<head>
{{ template "header.html" . }}
{{ template "header.txt" . }}
<title>{{ .lang.Strings.pageTitle }}</title>
</head>
<body class="max-w-full overflow-x-hidden section">

View File

@@ -17,7 +17,7 @@
window.matrixUserID = "{{ .matrixUser }}";
window.validationStrings = JSON.parse({{ .validationStrings }});
</script>
{{ template "header.html" . }}
{{ template "header.txt" . }}
<title>{{ .strings.myAccount }}</title>
</head>
<body class="max-w-full overflow-x-hidden section">