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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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