Skip to content

Commit f9eba80

Browse files
Merge branch 'main' of https://github.com/retypeapp/retype
2 parents eb6dea2 + 7c00f51 commit f9eba80

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

configuration/actions.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Action {.whitespace-nowrap} | Description
8888
`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.
8989
`print-page` | Opens the browser print dialog.
9090
`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.
9192
`view-page-markdown` | Opens the generated Markdown export for the current page in a new tab.
9293

9394
### copy-page-markdown
@@ -159,6 +160,18 @@ actions:
159160
icon: arrow-up
160161
```
161162

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+
162175
### view-page-markdown
163176

164177
The `view-page-markdown` action opens the generated Markdown export for the current page in a new tab.
@@ -306,6 +319,7 @@ Handler | Description
306319
`fetch` | Fetch text content from a URL.
307320
`print` | Open the browser print dialog.
308321
`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.
309323

310324
### clipboard
311325

@@ -364,3 +378,20 @@ steps:
364378
```
365379

366380
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

Comments
 (0)