You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`copy-to-clipboard`| Copies the current browser URL to the clipboard. In custom action definitions, use the `clipboard` handler when you need to copy a specific value.
89
89
`print-page`| Opens the browser print dialog.
90
90
`scroll-to-top`| Smoothly scrolls to the top of the page.
91
+
`share-page`| Opens the native share panel for the current page when available, otherwise copies the current browser URL to the clipboard.
91
92
`view-page-markdown`| Opens the generated Markdown export for the current page in a new tab.
92
93
93
94
### copy-page-markdown
@@ -159,6 +160,18 @@ actions:
159
160
icon: arrow-up
160
161
```
161
162
163
+
### share-page
164
+
165
+
The `share-page` action opens the native browser or operating system share panel for the current page when supported. If native sharing is not available, Retype copies the current page URL to the clipboard.
166
+
167
+
```yml retype.yml
168
+
actions:
169
+
items:
170
+
- text: Share page
171
+
action: share-page
172
+
icon: share
173
+
```
174
+
162
175
### view-page-markdown
163
176
164
177
The `view-page-markdown` action opens the generated Markdown export for the current page in a new tab.
@@ -306,6 +319,7 @@ Handler | Description
306
319
`fetch`| Fetch text content from a URL.
307
320
`print`| Open the browser print dialog.
308
321
`scroll`| Scroll to the top of the page or to a page target.
322
+
`share`| Open the native share panel, or copy the shared URL when native sharing is unavailable.
309
323
310
324
### clipboard
311
325
@@ -364,3 +378,20 @@ steps:
364
378
```
365
379
366
380
The handler returns an object with `success` and `target`.
381
+
382
+
### share
383
+
384
+
The `share` handler opens the native browser or operating system share panel. The input can include `title`, `text`, and `url`.
385
+
386
+
{%{
387
+
```yml _components/actions/share-site.yml
388
+
steps:
389
+
- handler: share
390
+
with:
391
+
title: "{{ page.title }}"
392
+
text: "{{ project.meta.siteName }}"
393
+
url: "{{ page.url }}"
394
+
```
395
+
}%}
396
+
397
+
If native sharing is not available, Retype copies the `url` value to the clipboard. The handler returns an object with `success`, and may include `fallback` and `value` when the clipboard fallback is used.
0 commit comments