diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-03 23:30:21 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-03 23:30:21 +0300 |
| commit | b1bf055da68e6f77650dbbd13320f377c543f470 (patch) | |
| tree | 1cac5590d6c8471b37048b6d6b26f79f9d4b4b5a /internal/generator/templates/shell.tmpl | |
| parent | 1b24076788868f50812468b1bf4bb0ae86214e8c (diff) | |
Add per-post share button with permalink (mobile view)
Each post now exposes a share button in its header that surfaces only on
mobile. Clicking it invokes navigator.share() with a permalink of the
form "<page>#post-<ID>", which the existing deep-link handler in
shared.js already opens directly in the modal.
When navigator.share is unavailable the link is copied to the clipboard
and a brief toast confirms the action; very old browsers fall back to
window.prompt.
Amp-Thread-ID: https://ampcode.com/threads/T-019e8f2a-b58e-72b3-b572-28d1fb1d9a1d
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/generator/templates/shell.tmpl')
| -rw-r--r-- | internal/generator/templates/shell.tmpl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/generator/templates/shell.tmpl b/internal/generator/templates/shell.tmpl index 71f18cd..5da78a5 100644 --- a/internal/generator/templates/shell.tmpl +++ b/internal/generator/templates/shell.tmpl @@ -58,6 +58,9 @@ <div class="post-header"> <div><strong>@snonux</strong></div> <div class="post-time">{{$post.FormattedTime}}</div> + <button type="button" class="post-share-btn" data-share-id="{{$post.ID}}" aria-label="Share post link"> + <i class="fas fa-share-nodes" aria-hidden="true"></i> + </button> </div> <div class="post-text">{{$post.ContentHTML}}</div> </div> |
