@rmdes/indiekit-endpoint-share
v1.1.2
Published
Enhanced share endpoint for Indiekit. Supports bookmark and note post types via type selector.
Maintainers
Readme
@indiekit/endpoint-share
Share endpoint for Indiekit. Provides a simple interface for bookmarking websites and publishing them on your website. Inspired and developed from an idea originally described by Max Böck.
Installation
npm install @indiekit/endpoint-share
[!NOTE] This package is installed alongside
@indiekit/indiekit
Usage
To customise the behaviour of this plug-in, add @indiekit/endpoint-share to your configuration, specifying options as required:
{
"@indiekit/endpoint-share": {
"mountPath": "/teilen", // de-DE
},
}Options
| Option | Type | Description |
| :---------- | :------- | :------------------------------------------------------ |
| mountPath | string | Path to share screen. Optional, defaults to /share. |
Pre-filling the form
The share endpoint accepts query parameters to pre-fill form fields. This allows external services and browser extensions to populate the form automatically.
| Parameter | Description |
| :-------- | :--------------------------------- |
| url | URL to bookmark. |
| name | Title of the post. |
| content | Body text of the post. Optional. |
The form also offers a checkbox for each syndication target the publication has configured; the targets chosen are sent to the Micropub endpoint as mp-syndicate-to, one value per target.
To enable services like ShareOpenly to share to your site, add a <link> element with rel="share-url" to your homepage:
<link rel="share-url" href="https://example.com/share?url={url}&name={title}&content={text}">Replace https://example.com/share with the URL of your share endpoint.
