Files
njump/templates/telegram_instant_view.html

51 lines
1.6 KiB
HTML

<meta charset="UTF-8" />
<!-- check https://nikstar.me/post/instant-view/ for more information on how this was set up -->
<!-- required stuff so telegram treats us like a medium.com article -->
<meta property="al:android:app_name" content="Medium" />
<meta property="article:published_time" content="{{.CreatedAt}}" />
<!-- stuff that goes in the actual telegram message preview -->
<meta property="og:site_name" content="{{.AuthorLong}}" />
{{ if not (eq "" .Description) }}
<meta property="og:description" content="{{.Description}}" />
{{ end }}
<!---->
{{ if not (eq "" .Image) }}
<meta property="og:image" content="{{.Image}}" />
{{ end }}
<!---->
{{ if not (eq "" .Video) }}
<meta property="og:video" content="{{.Video}}" />
<meta property="og:video:secure_url" content="{{.Video}}" />
<meta property="og:video:type" content="video/{{.VideoType}}" />
{{ end }}
<!-- stuff that affects the content inside the preview window -->
<meta name="author" content="{{.Metadata.ShortName}}" />
<meta name="telegram:channel" content="@nostr_protocol" />
<!-- basic content of the preview window -->
<article>
<h1>
{{ if not (eq "" .Subject) }} {{.Subject}} {{ else }}
<a href="/{{.Metadata.Npub}}">{{.Metadata.ShortName}}</a> on Nostr: {{ end
}}
</h1>
{{ if not (eq "" .ParentLink) }}
<aside>in reply to {{ .ParentLink }}</aside>
{{ end }}
<!---->
{{ if not (eq "" .Summary) }}
<aside>{{ .Summary }}</aside>
{{ end }}
<!---->
{{.Content}} {{ if not (eq "" .Subject) }}
<aside>
<a href="/{{.Metadata.Npub}}">{{.Metadata.ShortName}}</a>
</aside>
{{ end }}
</article>