chore: format html better
This commit is contained in:
parent
74fa69274d
commit
c4191ec6cd
2
go.mod
2
go.mod
@ -5,7 +5,7 @@ go 1.24.1
|
|||||||
require (
|
require (
|
||||||
github.com/mattn/go-sqlite3 v1.14.24
|
github.com/mattn/go-sqlite3 v1.14.24
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.6.0
|
||||||
go.yarn.social/lextwt v0.1.5-0.20250328015012-42a9ffb46fea
|
go.yarn.social/lextwt v0.1.5-0.20250402191850-311481301a38
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
2
go.sum
2
go.sum
@ -114,6 +114,8 @@ go.yarn.social/lextwt v0.1.5-0.20250327005027-02d9b44de4dd h1:Np3zWtQ0GB9WhRFCPb
|
|||||||
go.yarn.social/lextwt v0.1.5-0.20250327005027-02d9b44de4dd/go.mod h1:P36NPegLbhbFa1A0JOLsDyIQcdM0zdmx8kPKACXry4A=
|
go.yarn.social/lextwt v0.1.5-0.20250327005027-02d9b44de4dd/go.mod h1:P36NPegLbhbFa1A0JOLsDyIQcdM0zdmx8kPKACXry4A=
|
||||||
go.yarn.social/lextwt v0.1.5-0.20250328015012-42a9ffb46fea h1:sbWswg5s8VaXB1hBQDs4KOBRBN2jPKtfFlcCQ3EThZk=
|
go.yarn.social/lextwt v0.1.5-0.20250328015012-42a9ffb46fea h1:sbWswg5s8VaXB1hBQDs4KOBRBN2jPKtfFlcCQ3EThZk=
|
||||||
go.yarn.social/lextwt v0.1.5-0.20250328015012-42a9ffb46fea/go.mod h1:P36NPegLbhbFa1A0JOLsDyIQcdM0zdmx8kPKACXry4A=
|
go.yarn.social/lextwt v0.1.5-0.20250328015012-42a9ffb46fea/go.mod h1:P36NPegLbhbFa1A0JOLsDyIQcdM0zdmx8kPKACXry4A=
|
||||||
|
go.yarn.social/lextwt v0.1.5-0.20250402191850-311481301a38 h1:WOPc9ZXRLGqQmQazfh3x7QqtYAIvUAnWq+oE3+aHZQA=
|
||||||
|
go.yarn.social/lextwt v0.1.5-0.20250402191850-311481301a38/go.mod h1:P36NPegLbhbFa1A0JOLsDyIQcdM0zdmx8kPKACXry4A=
|
||||||
go.yarn.social/types v0.0.0-20250108134258-ed75fa653ede h1:XV9tuDQ605xxH4qIQPRHM1bOa7k0rJZ2RqA5kz2Nun4=
|
go.yarn.social/types v0.0.0-20250108134258-ed75fa653ede h1:XV9tuDQ605xxH4qIQPRHM1bOa7k0rJZ2RqA5kz2Nun4=
|
||||||
go.yarn.social/types v0.0.0-20250108134258-ed75fa653ede/go.mod h1:+xnDkQ0T0S8emxWIsvxlCAoyF8gBaj0q81hr/VrKc0c=
|
go.yarn.social/types v0.0.0-20250108134258-ed75fa653ede/go.mod h1:+xnDkQ0T0S8emxWIsvxlCAoyF8gBaj0q81hr/VrKc0c=
|
||||||
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
|
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
|
||||||
|
22
http-html.go
22
http-html.go
@ -70,10 +70,10 @@ func (a *HTML) conv(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
|
|
||||||
hash := r.PathValue("hash")
|
hash := r.PathValue("hash")
|
||||||
if (len(hash) < 6 || len(hash) > 8) && !notAny(hash, "abcdefghijklmnopqrstuvwxyz234567") {
|
// if (len(hash) < 6 || len(hash) > 8) && !notAny(hash, "abcdefghijklmnopqrstuvwxyz234567") {
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
// w.WriteHeader(http.StatusBadRequest)
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
limit := 100
|
limit := 100
|
||||||
if v, ok := strconv.Atoi(r.URL.Query().Get("limit")); ok == nil {
|
if v, ok := strconv.Atoi(r.URL.Query().Get("limit")); ok == nil {
|
||||||
@ -117,17 +117,23 @@ func (r *HTWriter) WriteTo(w io.Writer) (int64, error) {
|
|||||||
<head>
|
<head>
|
||||||
<title>The Watcher</title>
|
<title>The Watcher</title>
|
||||||
<style>
|
<style>
|
||||||
body { width: 70%; margin: auto; background: black; color: white; }
|
@import url('https://fonts.cdnfonts.com/css/open-dyslexic');
|
||||||
|
|
||||||
|
body { font-family: 'Open-Dyslexic', sans-serif; width: 70%; margin: auto; background: black; color: white; }
|
||||||
a { color: cornflowerblue; text-decoration: none; }
|
a { color: cornflowerblue; text-decoration: none; }
|
||||||
main { }
|
main { }
|
||||||
|
pre { white-space: pre-wrap; }
|
||||||
pre.preamble { color: green; }
|
pre.preamble { color: green; }
|
||||||
article { border: 1px solid green; border-radius: 4px; padding: 4px; margin: 2px; }
|
article { background-color: #333; border: 1px solid green; border-radius: 4px; padding: 4px; margin: 2px; }
|
||||||
|
article pre { color: orange; }
|
||||||
.h-card { columns: 2; }
|
.h-card { columns: 2; }
|
||||||
.h-card .author { display: flex; }
|
.h-card .author { display: flex; }
|
||||||
.h-card .icon { width: 36px; margin: 4px; }
|
.h-card .icon { width: 36px; margin: 4px; }
|
||||||
.h-card .u-photo { width: 32px; }
|
.h-card .u-photo { width: 32px; }
|
||||||
.h-card .date { text-align: right;}
|
.h-card .date { text-align: right;}
|
||||||
section { overflow: scroll; }
|
.p-org a { color: darkgrey; }
|
||||||
|
section { padding: 1em; border: 1px solid darkgreen; background-color: #111; }
|
||||||
|
section img { max-width: 100%; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body onload="setTimestamps()">
|
<body onload="setTimestamps()">
|
||||||
@ -191,7 +197,7 @@ func (r *HTWriter) WriteTo(w io.Writer) (int64, error) {
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<pre>%M</pre>
|
%h
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user