From c5666b8a6b96dc22edb062860217bab96ac43174 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Sun, 1 Nov 2020 23:23:58 +0000 Subject: [PATCH] =?UTF-8?q?feat(syndicator-internet-archive):=20add=20supp?= =?UTF-8?q?ort=20for=20=E2=80=98checked=E2=80=99=20property?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/syndicator-internet-archive/README.md | 7 +++++++ packages/syndicator-internet-archive/index.js | 2 ++ packages/syndicator-internet-archive/tests/index.js | 1 + 3 files changed, 10 insertions(+) diff --git a/packages/syndicator-internet-archive/README.md b/packages/syndicator-internet-archive/README.md index 60b300298..0a253b108 100644 --- a/packages/syndicator-internet-archive/README.md +++ b/packages/syndicator-internet-archive/README.md @@ -41,6 +41,13 @@ Name for this syndicator that may appear in a Micropub client’s publishing int Type: `string`\ *Optional*, defaults to `Internet Archive` +### `checked` + +Tell a Micropub client whether this syndicator should be enabled by default. + +Type: `boolean`\ +*Optional*, defaults to `false` + ### `uid` Value Micropub client will include when publishing a post to indicate that it should be sent to this syndicator. diff --git a/packages/syndicator-internet-archive/index.js b/packages/syndicator-internet-archive/index.js index 2a2ab6481..8742722a2 100644 --- a/packages/syndicator-internet-archive/index.js +++ b/packages/syndicator-internet-archive/index.js @@ -5,6 +5,7 @@ import {internetArchive} from './lib/internet-archive.js'; export const debug = new Debug('indiekit:syndicator-internet-archive'); const defaults = { + checked: false, name: 'Internet Archive', uid: 'https://web.archive.org/' }; @@ -18,6 +19,7 @@ export const InternetArchiveSyndicator = class { get info() { return { + checked: this.options.checked, name: this.options.name, uid: this.options.uid, service: { diff --git a/packages/syndicator-internet-archive/tests/index.js b/packages/syndicator-internet-archive/tests/index.js index 39749b078..aa3f397a3 100644 --- a/packages/syndicator-internet-archive/tests/index.js +++ b/packages/syndicator-internet-archive/tests/index.js @@ -16,6 +16,7 @@ test.beforeEach(t => { test('Gets info', t => { const result = new InternetArchiveSyndicator(); + t.false(result.info.checked); t.is(result.info.name, 'Internet Archive'); t.is(result.info.uid, 'https://web.archive.org/'); t.truthy(result.info.service);