mirror of
https://github.com/aljazceru/njump.git
synced 2026-01-31 11:44:34 +01:00
Add html to prettier and prettify the templates
This commit is contained in:
2
justfile
2
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 .
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html class="theme--default">
|
||||
<meta charset="UTF-8" />
|
||||
<head>
|
||||
@@ -17,39 +17,42 @@
|
||||
{{.title}}
|
||||
<span class="display"> </span>
|
||||
</div>
|
||||
<div class="pic-wrapper">
|
||||
|
||||
</div>
|
||||
<div class="pic-wrapper"></div>
|
||||
</div>
|
||||
|
||||
<div class="column column_content">
|
||||
<div class="field info-wrapper">
|
||||
<h1 class="name">
|
||||
{{.title}}
|
||||
</h1>
|
||||
<h1 class="name">{{.title}}</h1>
|
||||
</div>
|
||||
<div class="field separator long"></div>
|
||||
|
||||
<div class="field last_notes">
|
||||
{{range $element := .data }}
|
||||
<a href="/{{$.pathPrefix}}{{$element | trimProtocol | escapeString}}" class="note">
|
||||
<a
|
||||
href="/{{$.pathPrefix}}{{$element | trimProtocol | escapeString}}"
|
||||
class="note"
|
||||
>
|
||||
<div class="content">{{$element | escapeString}}</div>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if not (eq .prevPage "0")}}
|
||||
<a href="/{{.paginationUrl}}/{{.prevPage | escapeString}}" class="pagination prev"><< Prev page</a>
|
||||
<a
|
||||
href="/{{.paginationUrl}}/{{.prevPage | escapeString}}"
|
||||
class="pagination prev"
|
||||
><< Prev page</a
|
||||
>
|
||||
{{end}} {{if not (eq .nextPage "0")}}
|
||||
<a
|
||||
href="/{{.paginationUrl}}/{{.nextPage | escapeString}}"
|
||||
class="pagination next"
|
||||
>Next page >></a
|
||||
>
|
||||
{{end}}
|
||||
|
||||
{{if not (eq .nextPage "0")}}
|
||||
<a href="/{{.paginationUrl}}/{{.nextPage | escapeString}}" class="pagination next">Next page >></a>
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
|
||||
<aside class="column column_clients"></aside>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,22 +1,32 @@
|
||||
<div class="field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}}">
|
||||
<div
|
||||
class='field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}}'
|
||||
>
|
||||
<div class="label">Published at</div>
|
||||
{{.createdAt | escapeString}}
|
||||
</div>
|
||||
|
||||
<div class="field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}}">
|
||||
<div
|
||||
class='field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}}'
|
||||
>
|
||||
<div class="label">Kind type</div>
|
||||
{{.event.Kind}}
|
||||
{{ if not (eq .kindNIP "")}}
|
||||
- <a href="https://github.com/nostr-protocol/nips/blob/master/{{.kindNIP | escapeString}}.md">{{.kindDescription | escapeString}}</a>
|
||||
{{.event.Kind}} {{ if not (eq .kindNIP "")}} -
|
||||
<a
|
||||
href="https://github.com/nostr-protocol/nips/blob/master/{{.kindNIP | escapeString}}.md"
|
||||
>{{.kindDescription | escapeString}}</a
|
||||
>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<div class="field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}}">
|
||||
<div
|
||||
class='field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}}'
|
||||
>
|
||||
<div class="label">Address Code</div>
|
||||
<div>{{.nevent}}</div>
|
||||
</div>
|
||||
|
||||
<div class="field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}} boxed">
|
||||
<div
|
||||
class='field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}} boxed'
|
||||
>
|
||||
<div class="label">Event JSON</div>
|
||||
<div class="json">{{.eventJSON}}</div>
|
||||
</div>
|
||||
|
||||
@@ -2,13 +2,41 @@
|
||||
<link rel="stylesheet" href="/njump/static/styles.css?v=20230914" />
|
||||
|
||||
{{if eq .type "profile"}}
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/njump/static/favicon/profile/apple-touch-icon.png?v=2">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/njump/static/favicon/profile/favicon-32x32.png?v=2">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/njump/static/favicon/profile/favicon-16x16.png?v=2">
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="180x180"
|
||||
href="/njump/static/favicon/profile/apple-touch-icon.png?v=2"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
sizes="32x32"
|
||||
href="/njump/static/favicon/profile/favicon-32x32.png?v=2"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
sizes="16x16"
|
||||
href="/njump/static/favicon/profile/favicon-16x16.png?v=2"
|
||||
/>
|
||||
{{else}}
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/njump/static/favicon/event/apple-touch-icon.png?v=2">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/njump/static/favicon/event/favicon-32x32.png?v=2">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/njump/static/favicon/event/favicon-16x16.png?v=2">
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="180x180"
|
||||
href="/njump/static/favicon/event/apple-touch-icon.png?v=2"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
sizes="32x32"
|
||||
href="/njump/static/favicon/event/favicon-32x32.png?v=2"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
sizes="16x16"
|
||||
href="/njump/static/favicon/event/favicon-16x16.png?v=2"
|
||||
/>
|
||||
{{end}}
|
||||
<link rel="manifest" href="/njump/static/favicon/site.webmanifest">
|
||||
<meta name="theme-color" content="#e42a6d">
|
||||
<link rel="manifest" href="/njump/static/favicon/site.webmanifest" />
|
||||
<meta name="theme-color" content="#e42a6d" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html class="theme--default">
|
||||
<meta charset="UTF-8" />
|
||||
<head>
|
||||
@@ -140,8 +140,8 @@
|
||||
>NIP-05</a
|
||||
>
|
||||
inspired permalink:
|
||||
<span class="exampleUrl">{{ s.CanonicalHost }}/<nip-5></span
|
||||
>, for example:
|
||||
<span class="exampleUrl">{{ s.CanonicalHost }}/<nip-5></span>,
|
||||
for example:
|
||||
<a href="/nvk.org">https://{{ s.CanonicalHost }}/nvk.org</a> or
|
||||
<a href="/mike@mikedilger.com"
|
||||
>https://{{ s.CanonicalHost }}/mike@mikedilger.com</a
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html class="theme--default">
|
||||
<meta charset="UTF-8" />
|
||||
<head>
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html class="theme--default">
|
||||
<meta charset="UTF-8" />
|
||||
<head>
|
||||
{{ if eq .type "address" }}
|
||||
<title>Nostr Address {{.naddr | escapeString }}</title>
|
||||
{{end}}
|
||||
{{ if eq .type "other" }}
|
||||
<title>Nostr Event {{.kindID}} - {{.kindDescription | escapeString }}</title>
|
||||
{{end}}
|
||||
|
||||
{{template "head_common.html" .}}
|
||||
{{end}} {{ if eq .type "other" }}
|
||||
<title>
|
||||
Nostr Event {{.kindID}} - {{.kindDescription | escapeString }}
|
||||
</title>
|
||||
{{end}} {{template "head_common.html" .}}
|
||||
</head>
|
||||
|
||||
<body class="other">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html class="theme--default">
|
||||
<meta charset="UTF-8" />
|
||||
<head>
|
||||
|
||||
@@ -1,22 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html class="theme--default">
|
||||
<meta charset="UTF-8" />
|
||||
<head>
|
||||
<title>Nostr Relay {{.hostname | escapeString}} - {{.info.Name | escapeString}}</title>
|
||||
<meta property="og:title" content="{{.hostname | escapeString}} - nostr relay" />
|
||||
<meta name="twitter:title" content="{{.hostname | escapeString}} - nostr relay" />
|
||||
<meta property="og:site_name" content="{{.hostname | escapeString}} - nostr relay" />
|
||||
<title>
|
||||
Nostr Relay {{.hostname | escapeString}} - {{.info.Name | escapeString}}
|
||||
</title>
|
||||
<meta
|
||||
property="og:title"
|
||||
content="{{.hostname | escapeString}} - nostr relay"
|
||||
/>
|
||||
<meta
|
||||
name="twitter:title"
|
||||
content="{{.hostname | escapeString}} - nostr relay"
|
||||
/>
|
||||
<meta
|
||||
property="og:site_name"
|
||||
content="{{.hostname | escapeString}} - nostr relay"
|
||||
/>
|
||||
{{ if .info.Icon }}
|
||||
<meta property="og:image" content="{{.info.Icon | escapeString}}" />
|
||||
<meta property="twitter:image" content="{{.proxy}}{{.info.Icon | escapeString}}" />
|
||||
{{end}}
|
||||
{{ if .info.Description }}
|
||||
<meta property="og:description" content="{{.info.Description | escapeString}}" />
|
||||
<meta name="twitter:description" content="{{.info.Description | escapeString}}" />
|
||||
<meta
|
||||
property="twitter:image"
|
||||
content="{{.proxy}}{{.info.Icon | escapeString}}"
|
||||
/>
|
||||
{{end}} {{ if .info.Description }}
|
||||
<meta
|
||||
property="og:description"
|
||||
content="{{.info.Description | escapeString}}"
|
||||
/>
|
||||
<meta
|
||||
name="twitter:description"
|
||||
content="{{.info.Description | escapeString}}"
|
||||
/>
|
||||
{{end}}
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
<link rel="sitemap" type="application/xml" title="Sitemap for {{.hostname | escapeString}}" href="/r/{{.hostname | escapeString}}.xml">
|
||||
<link
|
||||
rel="sitemap"
|
||||
type="application/xml"
|
||||
title="Sitemap for {{.hostname | escapeString}}"
|
||||
href="/r/{{.hostname | escapeString}}.xml"
|
||||
/>
|
||||
|
||||
{{template "head_common.html" .}}
|
||||
</head>
|
||||
@@ -38,15 +62,11 @@
|
||||
|
||||
<div class="column column_content">
|
||||
<div class="field info-wrapper">
|
||||
<h1 class="name">
|
||||
{{.info.Name | escapeString}}
|
||||
</h1>
|
||||
<h1 class="name">{{.info.Name | escapeString}}</h1>
|
||||
</div>
|
||||
<div class="field separator long"></div>
|
||||
|
||||
<div class="field">
|
||||
wss://{{.hostname | escapeString}}
|
||||
</div>
|
||||
<div class="field">wss://{{.hostname | escapeString}}</div>
|
||||
<div class="field about">
|
||||
{{.info.Description | escapeString | basicFormatting}}
|
||||
</div>
|
||||
@@ -57,8 +77,7 @@
|
||||
<div class="label">Public Key</div>
|
||||
{{.info.PubKey | escapeString}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .info.Contact}}
|
||||
{{end}} {{if .info.Contact}}
|
||||
<div class="field">
|
||||
<div class="label">Contact</div>
|
||||
<a href="{{.info.Contact | escapeString}}"
|
||||
@@ -66,22 +85,26 @@
|
||||
>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
||||
<div class="field separator"></div>
|
||||
|
||||
<div class="field last_notes">
|
||||
<h2>Last Notes</h2>
|
||||
{{range .lastNotes}}
|
||||
<a href="/{{.Nevent | escapeString}}" class="note">
|
||||
|
||||
<div class="header">
|
||||
<div class="published_at">{{.CreatedAt | escapeString}}</div><br/>
|
||||
<div class="published_at">{{.CreatedAt | escapeString}}</div>
|
||||
<br />
|
||||
{{if not (eq .ParentNevent "")}}
|
||||
<div class="is_reply">- reply</div>
|
||||
{{end}}
|
||||
<div class="npub">by <span href="/{{.Npub}}">{{.NpubShort}}</span></div>
|
||||
<div class="npub">
|
||||
by <span href="/{{.Npub}}">{{.NpubShort}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
{{.Content | escapeString | previewNotesFormatting}}
|
||||
</div>
|
||||
<div class="content">{{.Content | escapeString | previewNotesFormatting}}</div>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user