diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2026-09-08 08:56:40 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2026-09-08 08:58:21 -0700 |
| commit | 735512086436dba4969107695ba7b93f09efce2e (patch) | |
| tree | 7bf014884a5d655d4477def39c9f794c9037b4fa | |
| parent | Use /tmp/hole as the hole directory for local runs (diff) | |
| download | roseh.moe-735512086436dba4969107695ba7b93f09efce2e.tar.zst | |
Simplify the HTML templates by omitting end tags
| -rw-r--r-- | templates/404.html.template | 27 | ||||
| -rw-r--r-- | templates/cmd-index.html.template | 27 | ||||
| -rw-r--r-- | templates/games/index.html.template | 16 | ||||
| -rw-r--r-- | templates/games/pong.html.template | 17 | ||||
| -rw-r--r-- | templates/games/rms.html.template | 16 | ||||
| -rw-r--r-- | templates/index.html.template | 26 | ||||
| -rw-r--r-- | templates/login.html.template | 40 | ||||
| -rw-r--r-- | templates/note.html.template | 54 | ||||
| -rw-r--r-- | templates/outline.html.template | 15 | ||||
| -rw-r--r-- | templates/pkg-index.html.template | 22 | ||||
| -rw-r--r-- | templates/wormhole-success.html.template | 16 | ||||
| -rw-r--r-- | templates/wormhole.html.template | 37 |
12 files changed, 133 insertions, 180 deletions
diff --git a/templates/404.html.template b/templates/404.html.template index 543a247..959e30f 100644 --- a/templates/404.html.template +++ b/templates/404.html.template @@ -1,17 +1,12 @@ -<!DOCTYPE html> +<!doctype html> <html lang="en"> - <head> - <title>Not Found</title> - <link rel="icon" href="/static/404/icon.webp"> - </head> - <body> - <center> - <div style="padding-top: 100px"> - <font size="10"><code>{{.Path}}</code> was not found</font> - </div> - <div style="position:fixed;bottom:0px;width:100%"> - <img src="/static/404/404.webp" alt="Reimu with question marks" style="height:50vh"> - </div> - </center> - </body> -</html> +<title>Not Found</title> +<link rel="icon" href="/static/404/icon.webp"> +<center> + <div style="padding-top: 100px"> + <font size="10"><code>{{.Path}}</code> was not found</font> + </div> + <div style="position:fixed;bottom:0px;width:100%"> + <img src="/static/404/404.webp" alt="Reimu with question marks" style="height:50vh"> + </div> +</center> diff --git a/templates/cmd-index.html.template b/templates/cmd-index.html.template index 16b89b0..3e581a3 100644 --- a/templates/cmd-index.html.template +++ b/templates/cmd-index.html.template @@ -1,17 +1,12 @@ -{{define "head" -}} - <title>Commands</title> -{{- end}} +<title>Commands</title> -{{define "body" -}} - <section> - <p>Command index</p> - <ul> - {{- range .Commands}} - <li> - <p><a href="https://pkg.go.dev/roseh.moe/cmd/{{.Name}}">{{.Name}}</a> - {{.Description}}</p> - <p><code>go install roseh.moe/cmd/{{.Name}}{{if .Multi}}/...{{end}}@latest</code></p> - </li> - {{- end}} - </ul> - </section> -{{- end}} +<section> + <p>Command index + <ul> + {{- range .Commands}} + <li> + <p><a href="https://pkg.go.dev/roseh.moe/cmd/{{.Name}}">{{.Name}}</a> - {{.Description}} + <p><code>go install roseh.moe/cmd/{{.Name}}{{if .Multi}}/...{{end}}@latest</code> + {{- end}} + </ul> +</section> diff --git a/templates/games/index.html.template b/templates/games/index.html.template index f235bd1..64cef30 100644 --- a/templates/games/index.html.template +++ b/templates/games/index.html.template @@ -1,10 +1,8 @@ -{{define "head"}}<title>Games</title>{{end}} +<title>Games</title> -{{define "body" -}} - <section> - <ul> - <li><a href="/games/pong">Pong</a> (warning: loud)</li> - <li><a href="/games/rms">RMS shooter</a></li> - </ul> - </section> -{{- end}} +<section> + <ul> + <li><a href="/games/pong">Pong</a> (warning: loud) + <li><a href="/games/rms">RMS shooter</a> + </ul> +</section> diff --git a/templates/games/pong.html.template b/templates/games/pong.html.template index a221023..8cb9226 100644 --- a/templates/games/pong.html.template +++ b/templates/games/pong.html.template @@ -1,11 +1,8 @@ -<!DOCTYPE html> +<!doctype html> <html lang="en" style="width:100%;height:100%;margin:0;padding:0"> - <head> - <title>Pong</title> - <link rel="icon" href="/static/games/pong/icon.webp"> - <script defer src="/static/games/pong/pong.js"></script> - </head> - <body style="width:100%;height:100%;margin:0;padding:0"> - <canvas id="pong" style="display:block;margin:0;padding:0"></canvas> - </body> -</html> +<title>Pong</title> +<link rel="icon" href="/static/games/pong/icon.webp"> +<script defer src="/static/games/pong/pong.js"></script> + +<body style="width:100%;height:100%;margin:0;padding:0"> +<canvas id="pong" style="display:block;margin:0;padding:0"></canvas> diff --git a/templates/games/rms.html.template b/templates/games/rms.html.template index 9f396fe..e657006 100644 --- a/templates/games/rms.html.template +++ b/templates/games/rms.html.template @@ -1,12 +1,8 @@ -{{define "head" -}} - <title>RMS shooter</title> - <script src="/static/games/rms/rms.js" defer></script> -{{- end}} +<title>RMS shooter</title> -{{define "body" -}} - <img id="sprite-sheet" src="/static/games/rms/sprite-sheet.webp" hidden> +<script src="/static/games/rms/rms.js" defer></script> +<img id="sprite-sheet" src="/static/games/rms/sprite-sheet.webp" hidden> - <section> - <canvas id="canvas" width="800" height="600"></canvas> - </section> -{{- end}} +<section> + <canvas id="canvas" width="800" height="600"></canvas> +</section> diff --git a/templates/index.html.template b/templates/index.html.template index 45f4224..ed882e0 100644 --- a/templates/index.html.template +++ b/templates/index.html.template @@ -1,17 +1,15 @@ -{{define "head"}}<title>roseh.moe</title>{{end}} +<title>roseh.moe</title> -{{define "body" -}} - <div style="background-image:url(/static/index/stars.webp);background-repeat:repeat;height:500px;display:flex"> - <h1 style="margin:auto">roseh.moe</h1> - </div> +<div style="background-image:url(/static/index/stars.webp);background-repeat:repeat;height:500px;display:flex"> + <h1 style="margin:auto">roseh.moe</h1> +</div> - <section> - <div style="display:flex"> - <img src="/static/index/kanna.webp" alt="A dragon loli" style="border-radius:50%;margin:-145px auto 20px"> - </div> +<section> + <div style="display:flex"> + <img src="/static/index/kanna.webp" alt="A dragon loli" style="border-radius:50%;margin:-145px auto 20px"> + </div> - <p><a href="https://code.roseh.moe">Projects</a></p> - <p><a href="/games/">Games?</a></p> - <p><a href="/wormhole">Magic wormhole</a></p> - </section> -{{- end}} + <p><a href="https://code.roseh.moe">Projects</a> + <p><a href="/games/">Games?</a> + <p><a href="/wormhole">Magic wormhole</a> +</section> diff --git a/templates/login.html.template b/templates/login.html.template index ce46bd1..2b3d022 100644 --- a/templates/login.html.template +++ b/templates/login.html.template @@ -1,24 +1,20 @@ -{{define "head"}}<title>Login</title>{{end}} +<title>Login</title> -{{define "body" -}} - <section> - {{- if .Error}} - <p class="login-error"><img class="inline" src="/static/angry.webp">Incorrect password</p> - {{- end}} - <form class="password-form" method="post"> - <table> - <tr class="password-form-row"> - <td><label class="password-label" for="password">Enter password</label></td> - <td><input id="password" class="password" type="password" name="password" autofocus></td> - </tr> - <tr class="password-form-row"> - <td><label class="password-label" for="auth">Google authenticator code</label></td> - <td><input id="auth" class="password" name="auth"></td> - </tr> - <tr> - <td></td> - <td><input type="image" width="100" class="submit" src="/static/point.webp" alt="Submit"></td> - </table> - </form> - </section> +<section> +{{- if .Error}} + <p class="login-error"><img class="inline" src="/static/angry.webp">Incorrect password {{- end}} + <form class="password-form" method="post"> + <table> + <tr class="password-form-row"> + <td><label class="password-label" for="password">Enter password</label> + <td><input id="password" class="password" type="password" name="password" autofocus> + <tr class="password-form-row"> + <td><label class="password-label" for="auth">Google authenticator code</label> + <td><input id="auth" class="password" name="auth"> + <tr> + <td> + <td><input type="image" width="100" class="submit" src="/static/point.webp" alt="Submit"> + </table> + </form> +</section> diff --git a/templates/note.html.template b/templates/note.html.template index ff72bdf..0d4673d 100644 --- a/templates/note.html.template +++ b/templates/note.html.template @@ -1,31 +1,27 @@ -{{define "head" -}} - <script src="/static/htmx.min.js"></script> - <title>Notepad</title> +<script src="/static/htmx.min.js"></script> +<title>Notepad</title> - <meta name="viewport" content="interactive-widget=resizes-content"> <!-- https://stackoverflow.com/q/76026292 --> -{{- end}} +<meta name="viewport" content="interactive-widget=resizes-content"> <!-- https://stackoverflow.com/q/76026292 --> -{{define "body" -}} - <form id="form" method="post"> - <div class="save-indicator-container"> - {{block "saveIndicator" ""}}<span id="save-indicator">{{.}}</span>{{end}} - </div> - <div class="content-container"> - <textarea - name="content" - hx-post="/notepad" - hx-on:input=" - const indicator = htmx.find('#save-indicator'); - htmx.addClass(indicator, 'htmx-indicator'); - indicator.innerHTML = 'Saving...'; - " - hx-trigger="input delay:1s" - hx-indicator="#save-indicator" - hx-target="#save-indicator" - hx-swap="outerHTML" - autofocus> - {{- .Content -}} - </textarea> - </div> - </form> -{{- end}} +<form id="form" method="post"> + <div class="save-indicator-container"> + {{block "saveIndicator" ""}}<span id="save-indicator">{{.}}</span>{{end}} + </div> + <div class="content-container"> + <textarea + name="content" + hx-post="/notepad" + hx-on:input=" + const indicator = htmx.find('#save-indicator'); + htmx.addClass(indicator, 'htmx-indicator'); + indicator.innerHTML = 'Saving...'; + " + hx-trigger="input delay:1s" + hx-indicator="#save-indicator" + hx-target="#save-indicator" + hx-swap="outerHTML" + autofocus> + {{- .Content -}} + </textarea> + </div> +</form> diff --git a/templates/outline.html.template b/templates/outline.html.template index 6ef1fe0..78f7920 100644 --- a/templates/outline.html.template +++ b/templates/outline.html.template @@ -1,12 +1,7 @@ -<!DOCTYPE html> +<!doctype html> <html lang="en"> - <head> - <link rel="icon" href="/favicon.ico"> - <link rel="stylesheet" href="/static/styles.css"> +<meta charset="utf-8"> +<link rel="icon" href="/favicon.ico"> +<link rel="stylesheet" href="/static/styles.css"> - {{template "head" .}} - </head> - <body> - {{template "body" .}} - </body> -</html> +{{template "body" .}} diff --git a/templates/pkg-index.html.template b/templates/pkg-index.html.template index fc88ed4..67417c2 100644 --- a/templates/pkg-index.html.template +++ b/templates/pkg-index.html.template @@ -1,14 +1,10 @@ -{{define "head" -}} - <title>Packages</title> -{{- end}} +<title>Packages</title> -{{define "body" -}} - <section> - <p>Package index</p> - <ul> - {{- range .Packages}} - <li><p><a href="https://pkg.go.dev/roseh.moe/pkg/{{.Name}}">roseh.moe/pkg/{{.Name}}</a> - {{.Description}}</p></li> - {{- end}} - </ul> - </section> -{{- end}} +<section> + <p>Package index + <ul> + {{- range .Packages}} + <li><p><a href="https://pkg.go.dev/roseh.moe/pkg/{{.Name}}">roseh.moe/pkg/{{.Name}}</a> - {{.Description}} + {{- end}} + </ul> +</section> diff --git a/templates/wormhole-success.html.template b/templates/wormhole-success.html.template index dbb997e..86d060c 100644 --- a/templates/wormhole-success.html.template +++ b/templates/wormhole-success.html.template @@ -1,10 +1,8 @@ -{{define "head"}}<title>Uploaded!</title>{{end}} +<title>Uploaded!</title> -{{define "body" -}} - <div style="display:flex;flex-direction:column;align-items:center;font-size:50px"> - <p><a href="{{.URL}}">{{.URL}}</a></p> - <img src="{{.QR}}" alt="QR code for {{.URL}}" width="500px"> - <p>Uploaded!</p> - <img src="/static/tohru.webp" alt="An energetic dragon maid"> - </div> -{{- end}} +<div style="display:flex;flex-direction:column;align-items:center;font-size:50px"> + <p><a href="{{.URL}}">{{.URL}}</a></p> + <img src="{{.QR}}" alt="QR code for {{.URL}}" width="500px"> + <p>Uploaded!</p> + <img src="/static/tohru.webp" alt="An energetic dragon maid"> +</div> diff --git a/templates/wormhole.html.template b/templates/wormhole.html.template index 9c770c1..d277f4c 100644 --- a/templates/wormhole.html.template +++ b/templates/wormhole.html.template @@ -1,23 +1,16 @@ -{{define "head" -}} - <title>Wormhole</title> -{{- end}} +<title>Wormhole</title> -{{define "body" -}} - <form - method="post" - enctype="multipart/form-data" - class="wormhole"> - <ol> - <li> - <input type="file" name="file" multiple> - </li> - <li> - <input type="submit" value="Upload" class="wormhole-input"> - {{- if .Err}} - <p><img class="inline" src="/static/confused.webp" alt="A logical dragon maid"><span style="color:red">{{.Err}}</span></p> - {{- end}} - </li> - </ol> - Files will be deleted after 1 hour - </form> -{{- end}} +<form + method="post" + enctype="multipart/form-data" + class="wormhole"> + <ol> + <li> <input type="file" name="file" multiple> + <li> + <input type="submit" value="Upload" class="wormhole-input"> + {{- if .Err}} + <p><img class="inline" src="/static/confused.webp" alt="A logical dragon maid"><span style="color:red">{{.Err}}</span> + {{- end}} + </ol> + Files will be deleted after 1 hour +</form> |
