From c70baa79187b897e18295d015da70a9e7bac03c0 Mon Sep 17 00:00:00 2001 From: Daniele Tonon Date: Tue, 17 Oct 2023 19:03:57 +0200 Subject: [PATCH] Add html to prettier and prettify the templates --- justfile | 2 +- templates/archive.html | 33 ++++++++++-------- templates/details.html | 24 +++++++++---- templates/head_common.html | 44 ++++++++++++++++++----- templates/homepage.html | 6 ++-- templates/note.html | 2 +- templates/other.html | 13 ++++--- templates/profile.html | 2 +- templates/relay.html | 71 +++++++++++++++++++++++++------------- 9 files changed, 130 insertions(+), 67 deletions(-) diff --git a/justfile b/justfile index 11524e4..16175d1 100644 --- a/justfile +++ b/justfile @@ -9,5 +9,5 @@ deploy: build refresh_build: sass static/styles.scss static/styles.css - prettier -w static/*.css static/*.scss + prettier -w static/*.css static/*.scss templates/*.html go build -tags=nocache -o ./tmp/main . diff --git a/templates/archive.html b/templates/archive.html index e907256..baa687b 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -1,4 +1,4 @@ - + @@ -17,39 +17,42 @@ {{.title}}   -
- -
+
-

- {{.title}} -

+

{{.title}}

{{range $element := .data }} - +
{{$element | escapeString}}
{{end}}
{{if not (eq .prevPage "0")}} - + + {{end}}       {{if not (eq .nextPage "0")}} + {{end}} -       - {{if not (eq .nextPage "0")}} - - {{end}} -
- diff --git a/templates/details.html b/templates/details.html index b096757..5c99c4c 100644 --- a/templates/details.html +++ b/templates/details.html @@ -1,22 +1,32 @@ -
+
Published at
{{.createdAt | escapeString}}
-
+
Kind type
- {{.event.Kind}} - {{ if not (eq .kindNIP "")}} - - {{.kindDescription | escapeString}} + {{.event.Kind}} {{ if not (eq .kindNIP "")}} - + {{.kindDescription | escapeString}} {{ end }}
-
+
Address Code
{{.nevent}}
-
+
Event JSON
{{.eventJSON}}
diff --git a/templates/head_common.html b/templates/head_common.html index 8d6bfff..f294444 100644 --- a/templates/head_common.html +++ b/templates/head_common.html @@ -2,13 +2,41 @@ {{if eq .type "profile"}} - - - + + + {{else}} - - - + + + {{end}} - - \ No newline at end of file + + diff --git a/templates/homepage.html b/templates/homepage.html index f6044ad..f42cd84 100644 --- a/templates/homepage.html +++ b/templates/homepage.html @@ -1,4 +1,4 @@ - + @@ -140,8 +140,8 @@ >NIP-05 inspired permalink: - {{ s.CanonicalHost }}/<nip-5>, for example: + {{ s.CanonicalHost }}/<nip-5>, + for example: https://{{ s.CanonicalHost }}/nvk.org or https://{{ s.CanonicalHost }}/mike@mikedilger.com + diff --git a/templates/other.html b/templates/other.html index ebacd3c..9026460 100644 --- a/templates/other.html +++ b/templates/other.html @@ -1,15 +1,14 @@ - + {{ if eq .type "address" }} Nostr Address {{.naddr | escapeString }} - {{end}} - {{ if eq .type "other" }} - Nostr Event {{.kindID}} - {{.kindDescription | escapeString }} - {{end}} - - {{template "head_common.html" .}} + {{end}} {{ if eq .type "other" }} + + Nostr Event {{.kindID}} - {{.kindDescription | escapeString }} + + {{end}} {{template "head_common.html" .}} diff --git a/templates/profile.html b/templates/profile.html index e540365..40852c1 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -1,4 +1,4 @@ - + diff --git a/templates/relay.html b/templates/relay.html index 5df72c0..88888fd 100644 --- a/templates/relay.html +++ b/templates/relay.html @@ -1,22 +1,46 @@ - + - Nostr Relay {{.hostname | escapeString}} - {{.info.Name | escapeString}} - - - + + Nostr Relay {{.hostname | escapeString}} - {{.info.Name | escapeString}} + + + + {{ if .info.Icon }} - - {{end}} - {{ if .info.Description }} - - + + {{end}} {{ if .info.Description }} + + {{end}} - + {{template "head_common.html" .}} @@ -38,15 +62,11 @@
-

- {{.info.Name | escapeString}} -

+

{{.info.Name | escapeString}}

-
- wss://{{.hostname | escapeString}} -
+
wss://{{.hostname | escapeString}}
{{.info.Description | escapeString | basicFormatting}}
@@ -57,8 +77,7 @@
Public Key
{{.info.PubKey | escapeString}}
- {{end}} - {{if .info.Contact}} + {{end}} {{if .info.Contact}}
Contact
{{end}} - +