tailscale-dev / tclip

A pastebin for Tailscale users
BSD 3-Clause "New" or "Revised" License
154 stars 17 forks source link

cmd/tclipd: handle untitled pastes better #37

Closed Xe closed 1 year ago

Xe commented 1 year ago

Previously when you submitted a paste without a filename, it would create an unclickable link. This no longer happens.

Fixes #29

icio commented 1 year ago

LGTM. You could also fix the links for already-created pastes by adding some fallback text for {{.Filename}} to the template:

https://github.com/tailscale-dev/tclip/blob/2e7c60554916447f9a930e01c9942d749399b947/cmd/tclipd/tmpl/listpaste.html#L5

Xe commented 1 year ago

LGTM. You could also fix the links for already-created pastes by adding some fallback text for {{.Filename}} to the template:

https://github.com/tailscale-dev/tclip/blob/2e7c60554916447f9a930e01c9942d749399b947/cmd/tclipd/tmpl/listpaste.html#L5

This is fixed at the layer above template rendering.