@geekity/cms 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +270 -52
- package/admin/pages/documents/editor.njk +120 -0
- package/admin/pages/documents/syndication.njk +110 -0
- package/admin/pages/federation/followers.njk +7 -0
- package/admin/pages/media/library.njk +4 -3
- package/admin/pages/settings/general.njk +44 -0
- package/admin/static/admin.css +44 -0
- package/dist/admin/documents.d.ts +104 -0
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +220 -55
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/enclosure-field.d.ts +91 -0
- package/dist/admin/enclosure-field.d.ts.map +1 -0
- package/dist/admin/enclosure-field.js +282 -0
- package/dist/admin/enclosure-field.js.map +1 -0
- package/dist/admin/federation.d.ts +15 -0
- package/dist/admin/federation.d.ts.map +1 -1
- package/dist/admin/federation.js +19 -0
- package/dist/admin/federation.js.map +1 -1
- package/dist/admin/media.d.ts +7 -2
- package/dist/admin/media.d.ts.map +1 -1
- package/dist/admin/media.js +4 -2
- package/dist/admin/media.js.map +1 -1
- package/dist/admin/menu.d.ts.map +1 -1
- package/dist/admin/menu.js +3 -0
- package/dist/admin/menu.js.map +1 -1
- package/dist/admin/photo-field.d.ts +39 -0
- package/dist/admin/photo-field.d.ts.map +1 -0
- package/dist/admin/photo-field.js +91 -0
- package/dist/admin/photo-field.js.map +1 -0
- package/dist/admin/preview.d.ts.map +1 -1
- package/dist/admin/preview.js +6 -1
- package/dist/admin/preview.js.map +1 -1
- package/dist/admin/routes.d.ts.map +1 -1
- package/dist/admin/routes.js +4 -0
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/settings-general.d.ts.map +1 -1
- package/dist/admin/settings-general.js +36 -2
- package/dist/admin/settings-general.js.map +1 -1
- package/dist/admin/settings-page.d.ts.map +1 -1
- package/dist/admin/settings-page.js +1 -2
- package/dist/admin/settings-page.js.map +1 -1
- package/dist/admin/settings.d.ts +26 -0
- package/dist/admin/settings.d.ts.map +1 -1
- package/dist/admin/settings.js +88 -2
- package/dist/admin/settings.js.map +1 -1
- package/dist/admin/syndication-targets.d.ts +57 -0
- package/dist/admin/syndication-targets.d.ts.map +1 -0
- package/dist/admin/syndication-targets.js +266 -0
- package/dist/admin/syndication-targets.js.map +1 -0
- package/dist/admin/templates.d.ts +1 -0
- package/dist/admin/templates.d.ts.map +1 -1
- package/dist/admin/templates.js +1 -0
- package/dist/admin/templates.js.map +1 -1
- package/dist/admin/uploads.d.ts +13 -2
- package/dist/admin/uploads.d.ts.map +1 -1
- package/dist/admin/uploads.js +23 -5
- package/dist/admin/uploads.js.map +1 -1
- package/dist/config.d.ts +17 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -7
- package/dist/config.js.map +1 -1
- package/dist/content/citation.d.ts +36 -0
- package/dist/content/citation.d.ts.map +1 -0
- package/dist/content/citation.js +31 -0
- package/dist/content/citation.js.map +1 -0
- package/dist/content/enclosure.d.ts +69 -0
- package/dist/content/enclosure.d.ts.map +1 -0
- package/dist/content/enclosure.js +165 -0
- package/dist/content/enclosure.js.map +1 -0
- package/dist/content/index.d.ts +5 -1
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +2 -0
- package/dist/content/index.js.map +1 -1
- package/dist/content/media.d.ts +15 -2
- package/dist/content/media.d.ts.map +1 -1
- package/dist/content/media.js +92 -9
- package/dist/content/media.js.map +1 -1
- package/dist/content/photo.d.ts +45 -0
- package/dist/content/photo.d.ts.map +1 -0
- package/dist/content/photo.js +55 -0
- package/dist/content/photo.js.map +1 -0
- package/dist/content/post-type.d.ts +20 -8
- package/dist/content/post-type.d.ts.map +1 -1
- package/dist/content/post-type.js +17 -0
- package/dist/content/post-type.js.map +1 -1
- package/dist/federation/article.d.ts.map +1 -1
- package/dist/federation/article.js +93 -10
- package/dist/federation/article.js.map +1 -1
- package/dist/federation/citations.d.ts +38 -0
- package/dist/federation/citations.d.ts.map +1 -0
- package/dist/federation/citations.js +98 -0
- package/dist/federation/citations.js.map +1 -0
- package/dist/federation/delivery.d.ts.map +1 -1
- package/dist/federation/delivery.js +79 -31
- package/dist/federation/delivery.js.map +1 -1
- package/dist/images/alt-text.d.ts +6 -0
- package/dist/images/alt-text.d.ts.map +1 -1
- package/dist/images/alt-text.js +10 -0
- package/dist/images/alt-text.js.map +1 -1
- package/dist/images/icons.d.ts +5 -0
- package/dist/images/icons.d.ts.map +1 -1
- package/dist/images/icons.js +13 -8
- package/dist/images/icons.js.map +1 -1
- package/dist/images/paths.d.ts +1 -1
- package/dist/images/paths.d.ts.map +1 -1
- package/dist/images/paths.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -4
- package/dist/index.js.map +1 -1
- package/dist/indieauth/bearer.d.ts +6 -1
- package/dist/indieauth/bearer.d.ts.map +1 -1
- package/dist/indieauth/bearer.js +39 -12
- package/dist/indieauth/bearer.js.map +1 -1
- package/dist/indieauth/discovery.d.ts +9 -4
- package/dist/indieauth/discovery.d.ts.map +1 -1
- package/dist/indieauth/discovery.js +18 -7
- package/dist/indieauth/discovery.js.map +1 -1
- package/dist/micropub/create.d.ts +56 -0
- package/dist/micropub/create.d.ts.map +1 -0
- package/dist/micropub/create.js +200 -0
- package/dist/micropub/create.js.map +1 -0
- package/dist/micropub/endpoint.d.ts +21 -0
- package/dist/micropub/endpoint.d.ts.map +1 -0
- package/dist/micropub/endpoint.js +353 -0
- package/dist/micropub/endpoint.js.map +1 -0
- package/dist/micropub/media.d.ts +14 -0
- package/dist/micropub/media.d.ts.map +1 -0
- package/dist/micropub/media.js +93 -0
- package/dist/micropub/media.js.map +1 -0
- package/dist/micropub/update.d.ts +44 -0
- package/dist/micropub/update.d.ts.map +1 -0
- package/dist/micropub/update.js +133 -0
- package/dist/micropub/update.js.map +1 -0
- package/dist/web/assets.d.ts +14 -0
- package/dist/web/assets.d.ts.map +1 -1
- package/dist/web/assets.js +56 -1
- package/dist/web/assets.js.map +1 -1
- package/dist/web/context.d.ts +68 -3
- package/dist/web/context.d.ts.map +1 -1
- package/dist/web/context.js +56 -1
- package/dist/web/context.js.map +1 -1
- package/dist/web/feed-atom.d.ts.map +1 -1
- package/dist/web/feed-atom.js +20 -0
- package/dist/web/feed-atom.js.map +1 -1
- package/dist/web/feed-item.d.ts +19 -0
- package/dist/web/feed-item.d.ts.map +1 -1
- package/dist/web/feed-item.js +22 -0
- package/dist/web/feed-item.js.map +1 -1
- package/dist/web/feed-json.d.ts +13 -0
- package/dist/web/feed-json.d.ts.map +1 -1
- package/dist/web/feed-json.js +15 -0
- package/dist/web/feed-json.js.map +1 -1
- package/dist/web/feed-rss.d.ts.map +1 -1
- package/dist/web/feed-rss.js +59 -2
- package/dist/web/feed-rss.js.map +1 -1
- package/dist/web/feed-xml.d.ts +7 -1
- package/dist/web/feed-xml.d.ts.map +1 -1
- package/dist/web/feed-xml.js +8 -2
- package/dist/web/feed-xml.js.map +1 -1
- package/dist/web/feeds.d.ts +1 -1
- package/dist/web/feeds.d.ts.map +1 -1
- package/dist/web/feeds.js +6 -0
- package/dist/web/feeds.js.map +1 -1
- package/dist/web/index.d.ts +4 -1
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +2 -0
- package/dist/web/index.js.map +1 -1
- package/dist/web/license.d.ts +94 -0
- package/dist/web/license.d.ts.map +1 -0
- package/dist/web/license.js +116 -0
- package/dist/web/license.js.map +1 -0
- package/dist/web/oembed.d.ts.map +1 -1
- package/dist/web/oembed.js +1 -2
- package/dist/web/oembed.js.map +1 -1
- package/dist/web/render.d.ts +15 -0
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +27 -2
- package/dist/web/render.js.map +1 -1
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +10 -6
- package/dist/web/routes.js.map +1 -1
- package/dist/web/share-image.d.ts +7 -7
- package/dist/web/share-image.d.ts.map +1 -1
- package/dist/web/share-image.js +8 -7
- package/dist/web/share-image.js.map +1 -1
- package/dist/webmention/index.d.ts +2 -0
- package/dist/webmention/index.d.ts.map +1 -1
- package/dist/webmention/index.js +1 -0
- package/dist/webmention/index.js.map +1 -1
- package/dist/webmention/service.d.ts.map +1 -1
- package/dist/webmention/service.js +96 -18
- package/dist/webmention/service.js.map +1 -1
- package/dist/webmention/syndication.d.ts +135 -0
- package/dist/webmention/syndication.d.ts.map +1 -0
- package/dist/webmention/syndication.js +337 -0
- package/dist/webmention/syndication.js.map +1 -0
- package/package.json +1 -1
- package/themes/default/README.md +121 -37
- package/themes/default/layouts/base.njk +3 -4
- package/themes/default/layouts/post.njk +23 -6
- package/themes/default/partials/citations.njk +17 -0
- package/themes/default/partials/jsonld.njk +15 -6
- package/themes/default/partials/photos.njk +10 -0
- package/themes/default/partials/post-list.njk +7 -0
- package/themes/default/partials/recording.njk +41 -0
- package/themes/default/src/style.css +25 -0
- package/themes/default/static/style.css +41 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Document } from '../content/document.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Syndication targets (TASK-155): services such as IndieNews and Bridgy
|
|
4
|
+
* Publish that take a copy of a post when it links to them and sends them a
|
|
5
|
+
* webmention, and answer with the URL of the copy they made.
|
|
6
|
+
*
|
|
7
|
+
* Nothing here names a service. A site declares its targets in
|
|
8
|
+
* {@link SYNDICATION_TARGETS_FILE}; a post selects some with its
|
|
9
|
+
* `syndicate-to` list or by carrying a target's tag; the theme links to each
|
|
10
|
+
* one inside the post's h-entry; the sender notifies them as it notifies any
|
|
11
|
+
* linked page; and the URL each one answers with is kept in
|
|
12
|
+
* {@link SYNDICATION_FILE} (decision-26) and printed as `u-syndication`.
|
|
13
|
+
*/
|
|
14
|
+
/** Where a site declares its targets, relative to the content directory. */
|
|
15
|
+
export declare const SYNDICATION_TARGETS_FILE = "_data/syndicationTargets.json";
|
|
16
|
+
/**
|
|
17
|
+
* Where the copies targets answered with are kept, relative to the content
|
|
18
|
+
* directory: one object keyed by a post's permalink, each mapping a target's
|
|
19
|
+
* URL to the copy it made (decision-26). Eleventy reads it as `syndication`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SYNDICATION_FILE = "_data/syndication.json";
|
|
22
|
+
/** The front matter key a post lists the ids of its targets under. */
|
|
23
|
+
export declare const SYNDICATE_TO_FRONT_MATTER_KEY = "syndicate-to";
|
|
24
|
+
/** The front matter key, and mf2 property, for the URLs of a post's copies. */
|
|
25
|
+
export declare const SYNDICATION_FRONT_MATTER_KEY = "syndication";
|
|
26
|
+
/** What a target's `url` may hold to follow the post's language (TASK-156). */
|
|
27
|
+
export declare const LANGUAGE_PLACEHOLDER = "{lang}";
|
|
28
|
+
/** One place a post can be syndicated to. */
|
|
29
|
+
export interface SyndicationTarget {
|
|
30
|
+
/** What `syndicate-to` names it by, and its Micropub uid. */
|
|
31
|
+
readonly id: string;
|
|
32
|
+
/** What the editor's checkbox and the post's link say. */
|
|
33
|
+
readonly name: string;
|
|
34
|
+
/**
|
|
35
|
+
* The page the post links to and the webmention is sent to. As declared it
|
|
36
|
+
* may hold {@link LANGUAGE_PLACEHOLDER}; a target {@link selectedTargets}
|
|
37
|
+
* answers with has it filled for the post.
|
|
38
|
+
*/
|
|
39
|
+
readonly url: string;
|
|
40
|
+
/** A tag that selects this target without the post listing it. */
|
|
41
|
+
readonly tag?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* The languages, as canonical BCP 47 tags, the target takes posts in. A post
|
|
44
|
+
* in any other language does not select it. Absent means every language.
|
|
45
|
+
*/
|
|
46
|
+
readonly languages?: readonly string[] | undefined;
|
|
47
|
+
}
|
|
48
|
+
/** The declared targets, and a sentence for each entry that was not one. */
|
|
49
|
+
export interface ParsedSyndicationTargets {
|
|
50
|
+
readonly targets: readonly SyndicationTarget[];
|
|
51
|
+
readonly problems: readonly string[];
|
|
52
|
+
}
|
|
53
|
+
/** The keys a target is declared with, in the order a form or a file lists them. */
|
|
54
|
+
export type SyndicationTargetField = 'id' | 'name' | 'url' | 'tag' | 'languages';
|
|
55
|
+
/** A sentence for each key of one entry that is wrong. */
|
|
56
|
+
export type SyndicationTargetProblems = Partial<Record<SyndicationTargetField, string>>;
|
|
57
|
+
/** One entry checked: the target it declares, or what is wrong with each key. */
|
|
58
|
+
export type CheckedSyndicationTarget = {
|
|
59
|
+
readonly target: SyndicationTarget;
|
|
60
|
+
} | {
|
|
61
|
+
readonly problems: SyndicationTargetProblems;
|
|
62
|
+
};
|
|
63
|
+
/** One entry of the file as written, and what it declares or why it declares nothing. */
|
|
64
|
+
export type SyndicationEntry = {
|
|
65
|
+
readonly raw: unknown;
|
|
66
|
+
readonly target: SyndicationTarget;
|
|
67
|
+
} | {
|
|
68
|
+
readonly raw: unknown;
|
|
69
|
+
readonly problems: readonly string[];
|
|
70
|
+
};
|
|
71
|
+
/** The file's text read as a list of entries, or the one reason it is not a list. */
|
|
72
|
+
export type SyndicationEntries = {
|
|
73
|
+
readonly entries: readonly SyndicationEntry[];
|
|
74
|
+
} | {
|
|
75
|
+
readonly problem: string;
|
|
76
|
+
};
|
|
77
|
+
/** Read the targets file's text. An entry that is not a target is reported and left out. */
|
|
78
|
+
export declare function parseSyndicationTargets(text: string): ParsedSyndicationTargets;
|
|
79
|
+
/**
|
|
80
|
+
* Every entry of the targets file's text, each with the target it declares or
|
|
81
|
+
* its problems, in file order. A later entry repeating an earlier one's id
|
|
82
|
+
* declares nothing, so the first one wins.
|
|
83
|
+
*/
|
|
84
|
+
export declare function syndicationEntries(text: string): SyndicationEntries;
|
|
85
|
+
/** What an id another target already has is told. */
|
|
86
|
+
export declare function repeatedIdProblem(id: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* One entry as a target, or a sentence for each key that is wrong. The one
|
|
89
|
+
* rule a target is read by, whether it comes from the file or from the admin's
|
|
90
|
+
* form; whether its id is unique depends on the other entries, so that is the
|
|
91
|
+
* caller's.
|
|
92
|
+
*/
|
|
93
|
+
export declare function checkSyndicationTarget(entry: Readonly<Record<string, unknown>>): CheckedSyndicationTarget;
|
|
94
|
+
/**
|
|
95
|
+
* The targets a site declares, read from its content directory.
|
|
96
|
+
*
|
|
97
|
+
* Read on every call and parsed again only when the bytes change, the way the
|
|
98
|
+
* reply contexts are, so a target added by hand is offered on the next page.
|
|
99
|
+
*/
|
|
100
|
+
export interface SyndicationTargetsReader {
|
|
101
|
+
(): readonly SyndicationTarget[];
|
|
102
|
+
}
|
|
103
|
+
/** A reader over one content directory's targets file. A missing file declares none. */
|
|
104
|
+
export declare function syndicationTargetsReader(contentDir: string): SyndicationTargetsReader;
|
|
105
|
+
/** What is wrong with a content directory's targets file, for the boot log. */
|
|
106
|
+
export declare function syndicationTargetProblems(contentDir: string): readonly string[];
|
|
107
|
+
/**
|
|
108
|
+
* The declared targets a post selects, in the order the site declares them,
|
|
109
|
+
* each with its `url` filled for the post: those its `syndicate-to` names, and
|
|
110
|
+
* those whose tag it carries. An id nobody declared selects nothing.
|
|
111
|
+
*
|
|
112
|
+
* The post's language is its own `lang`, else `siteLanguage` (TASK-156). A
|
|
113
|
+
* target that lists `languages` is selected only for a post in one of them or
|
|
114
|
+
* in a regional form of one, so `de-AT` goes to a target that lists `de`, and
|
|
115
|
+
* {@link LANGUAGE_PLACEHOLDER} takes the listed tag; without a list it takes
|
|
116
|
+
* the post's. The one place the URL is decided, so the theme's link, the
|
|
117
|
+
* webmention and the stored copy's key cannot disagree.
|
|
118
|
+
*/
|
|
119
|
+
export declare function selectedTargets(document: Pick<Document, 'tags' | 'extra'>, targets: readonly SyndicationTarget[], siteLanguage: string): SyndicationTarget[];
|
|
120
|
+
/** The ids a post's `syndicate-to` lists, as written. */
|
|
121
|
+
export declare function syndicateToOf(extra: Record<string, unknown>): string[];
|
|
122
|
+
/** The copies an author listed by hand under `syndication`, each an http or https URL. */
|
|
123
|
+
export declare function handSyndicationOf(extra: Record<string, unknown>): string[];
|
|
124
|
+
/** The copies targets answered with, kept in {@link SYNDICATION_FILE}. */
|
|
125
|
+
export interface SyndicationCopies {
|
|
126
|
+
/** The copies one post has, by the target URL that made each. Never touches the network. */
|
|
127
|
+
read(permalink: string): Readonly<Record<string, string>>;
|
|
128
|
+
/** Set or, with `undefined`, remove one target's copy of one post. */
|
|
129
|
+
write(permalink: string, target: string, copy: string | undefined): Promise<void>;
|
|
130
|
+
/** Forget every copy of a post, as when it moves to another permalink. */
|
|
131
|
+
forget(permalink: string): Promise<void>;
|
|
132
|
+
}
|
|
133
|
+
/** The copies file of one content directory. */
|
|
134
|
+
export declare function syndicationCopies(contentDir: string): SyndicationCopies;
|
|
135
|
+
//# sourceMappingURL=syndication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syndication.d.ts","sourceRoot":"","sources":["../../src/webmention/syndication.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvD;;;;;;;;;;;GAWG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AAEzD,sEAAsE;AACtE,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAE5D,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,gBAAgB,CAAC;AAK1D,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,E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AAC,IAAI,CAAC,CAAC;CAC1C;AAED,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAuDvE"}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { readFileIfPresentSync, withFileLock, writeFileAtomicallySync } from '../files/atomic.js';
|
|
3
|
+
import { canonicalLocale, DEFAULT_LOCALE, documentLanguage } from '../web/locale.js';
|
|
4
|
+
/**
|
|
5
|
+
* Syndication targets (TASK-155): services such as IndieNews and Bridgy
|
|
6
|
+
* Publish that take a copy of a post when it links to them and sends them a
|
|
7
|
+
* webmention, and answer with the URL of the copy they made.
|
|
8
|
+
*
|
|
9
|
+
* Nothing here names a service. A site declares its targets in
|
|
10
|
+
* {@link SYNDICATION_TARGETS_FILE}; a post selects some with its
|
|
11
|
+
* `syndicate-to` list or by carrying a target's tag; the theme links to each
|
|
12
|
+
* one inside the post's h-entry; the sender notifies them as it notifies any
|
|
13
|
+
* linked page; and the URL each one answers with is kept in
|
|
14
|
+
* {@link SYNDICATION_FILE} (decision-26) and printed as `u-syndication`.
|
|
15
|
+
*/
|
|
16
|
+
/** Where a site declares its targets, relative to the content directory. */
|
|
17
|
+
export const SYNDICATION_TARGETS_FILE = '_data/syndicationTargets.json';
|
|
18
|
+
/**
|
|
19
|
+
* Where the copies targets answered with are kept, relative to the content
|
|
20
|
+
* directory: one object keyed by a post's permalink, each mapping a target's
|
|
21
|
+
* URL to the copy it made (decision-26). Eleventy reads it as `syndication`.
|
|
22
|
+
*/
|
|
23
|
+
export const SYNDICATION_FILE = '_data/syndication.json';
|
|
24
|
+
/** The front matter key a post lists the ids of its targets under. */
|
|
25
|
+
export const SYNDICATE_TO_FRONT_MATTER_KEY = 'syndicate-to';
|
|
26
|
+
/** The front matter key, and mf2 property, for the URLs of a post's copies. */
|
|
27
|
+
export const SYNDICATION_FRONT_MATTER_KEY = 'syndication';
|
|
28
|
+
/** What an id may be made of, so it can name a form field and a Micropub uid alike. */
|
|
29
|
+
const ID_PATTERN = /^[A-Za-z0-9._-]+$/;
|
|
30
|
+
/** What a target's `url` may hold to follow the post's language (TASK-156). */
|
|
31
|
+
export const LANGUAGE_PLACEHOLDER = '{lang}';
|
|
32
|
+
/** Read the targets file's text. An entry that is not a target is reported and left out. */
|
|
33
|
+
export function parseSyndicationTargets(text) {
|
|
34
|
+
const read = syndicationEntries(text);
|
|
35
|
+
if ('problem' in read)
|
|
36
|
+
return { targets: [], problems: [read.problem] };
|
|
37
|
+
const targets = [];
|
|
38
|
+
const problems = [];
|
|
39
|
+
read.entries.forEach((entry, index) => {
|
|
40
|
+
if ('target' in entry) {
|
|
41
|
+
targets.push(entry.target);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const id = isRecord(entry.raw) && typeof entry.raw['id'] === 'string' ? entry.raw['id'] : '';
|
|
45
|
+
const named = id === '' ? '' : ` ("${id}")`;
|
|
46
|
+
problems.push(`${SYNDICATION_TARGETS_FILE} entry ${String(index + 1)}${named} was ignored. ${entry.problems.join(' ')}`);
|
|
47
|
+
});
|
|
48
|
+
return { targets, problems };
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Every entry of the targets file's text, each with the target it declares or
|
|
52
|
+
* its problems, in file order. A later entry repeating an earlier one's id
|
|
53
|
+
* declares nothing, so the first one wins.
|
|
54
|
+
*/
|
|
55
|
+
export function syndicationEntries(text) {
|
|
56
|
+
let parsed;
|
|
57
|
+
try {
|
|
58
|
+
parsed = JSON.parse(text);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return { problem: `${SYNDICATION_TARGETS_FILE} is not valid JSON.` };
|
|
62
|
+
}
|
|
63
|
+
if (!Array.isArray(parsed)) {
|
|
64
|
+
return { problem: `${SYNDICATION_TARGETS_FILE} is not a list of targets.` };
|
|
65
|
+
}
|
|
66
|
+
const seen = new Set();
|
|
67
|
+
const entries = parsed.map((raw) => {
|
|
68
|
+
if (!isRecord(raw)) {
|
|
69
|
+
return { raw, problems: ['It is not an object with an id, a name and a url.'] };
|
|
70
|
+
}
|
|
71
|
+
const checked = checkSyndicationTarget(raw);
|
|
72
|
+
if ('problems' in checked)
|
|
73
|
+
return { raw, problems: Object.values(checked.problems) };
|
|
74
|
+
if (seen.has(checked.target.id)) {
|
|
75
|
+
return { raw, problems: [repeatedIdProblem(checked.target.id)] };
|
|
76
|
+
}
|
|
77
|
+
seen.add(checked.target.id);
|
|
78
|
+
return { raw, target: checked.target };
|
|
79
|
+
});
|
|
80
|
+
return { entries };
|
|
81
|
+
}
|
|
82
|
+
/** What an id another target already has is told. */
|
|
83
|
+
export function repeatedIdProblem(id) {
|
|
84
|
+
return `Another target already has the id "${id}".`;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* One entry as a target, or a sentence for each key that is wrong. The one
|
|
88
|
+
* rule a target is read by, whether it comes from the file or from the admin's
|
|
89
|
+
* form; whether its id is unique depends on the other entries, so that is the
|
|
90
|
+
* caller's.
|
|
91
|
+
*/
|
|
92
|
+
export function checkSyndicationTarget(entry) {
|
|
93
|
+
const { id, name, url, tag, languages } = entry;
|
|
94
|
+
const problems = {};
|
|
95
|
+
if (typeof id !== 'string' || !ID_PATTERN.test(id)) {
|
|
96
|
+
problems.id = 'An id is letters, digits, dots, dashes and underscores, and nothing else.';
|
|
97
|
+
}
|
|
98
|
+
if (typeof name !== 'string' || name.trim() === '')
|
|
99
|
+
problems.name = 'A target needs a name.';
|
|
100
|
+
const href = urlTemplate(url);
|
|
101
|
+
if (href === undefined) {
|
|
102
|
+
problems.url = `The url must be an http or https address. It may hold ${LANGUAGE_PLACEHOLDER} where the language goes.`;
|
|
103
|
+
}
|
|
104
|
+
if (tag !== undefined && (typeof tag !== 'string' || tag.trim() === '')) {
|
|
105
|
+
problems.tag = 'A tag must be a word, or left out.';
|
|
106
|
+
}
|
|
107
|
+
const tags = languages === undefined ? undefined : languageList(languages);
|
|
108
|
+
if (tags === null) {
|
|
109
|
+
problems.languages = 'Languages must be a list of language tags, such as en or de-AT.';
|
|
110
|
+
}
|
|
111
|
+
if (typeof id !== 'string' ||
|
|
112
|
+
typeof name !== 'string' ||
|
|
113
|
+
href === undefined ||
|
|
114
|
+
tags === null ||
|
|
115
|
+
Object.keys(problems).length > 0) {
|
|
116
|
+
return { problems };
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
target: {
|
|
120
|
+
id,
|
|
121
|
+
name: name.trim(),
|
|
122
|
+
url: href,
|
|
123
|
+
...(typeof tag === 'string' ? { tag: tag.trim() } : {}),
|
|
124
|
+
...(tags === undefined ? {} : { languages: tags }),
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A declared `url` as kept: an http or https URL, which may hold
|
|
130
|
+
* {@link LANGUAGE_PLACEHOLDER}. One with the placeholder is checked with a
|
|
131
|
+
* language filled in and kept as written, since a URL parser would escape the
|
|
132
|
+
* braces.
|
|
133
|
+
*/
|
|
134
|
+
function urlTemplate(value) {
|
|
135
|
+
if (typeof value !== 'string')
|
|
136
|
+
return undefined;
|
|
137
|
+
if (!value.includes(LANGUAGE_PLACEHOLDER))
|
|
138
|
+
return webUrl(value);
|
|
139
|
+
const template = value.trim();
|
|
140
|
+
return webUrl(fillLanguage(template, DEFAULT_LOCALE)) === undefined ? undefined : template;
|
|
141
|
+
}
|
|
142
|
+
/** A non-empty list of language tags, canonical, or `null` when it is not one. */
|
|
143
|
+
function languageList(value) {
|
|
144
|
+
if (!Array.isArray(value) || value.length === 0)
|
|
145
|
+
return null;
|
|
146
|
+
const tags = [];
|
|
147
|
+
for (const item of value) {
|
|
148
|
+
const tag = typeof item === 'string' ? canonicalLocale(item) : undefined;
|
|
149
|
+
if (tag === undefined)
|
|
150
|
+
return null;
|
|
151
|
+
tags.push(tag);
|
|
152
|
+
}
|
|
153
|
+
return tags;
|
|
154
|
+
}
|
|
155
|
+
/** A reader over one content directory's targets file. A missing file declares none. */
|
|
156
|
+
export function syndicationTargetsReader(contentDir) {
|
|
157
|
+
const file = path.join(contentDir, ...SYNDICATION_TARGETS_FILE.split('/'));
|
|
158
|
+
let cachedText;
|
|
159
|
+
let cached = [];
|
|
160
|
+
return () => {
|
|
161
|
+
const text = readFileIfPresentSync(file);
|
|
162
|
+
if (text === undefined) {
|
|
163
|
+
cachedText = undefined;
|
|
164
|
+
cached = [];
|
|
165
|
+
}
|
|
166
|
+
else if (text !== cachedText) {
|
|
167
|
+
cachedText = text;
|
|
168
|
+
cached = parseSyndicationTargets(text).targets;
|
|
169
|
+
}
|
|
170
|
+
return cached;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/** What is wrong with a content directory's targets file, for the boot log. */
|
|
174
|
+
export function syndicationTargetProblems(contentDir) {
|
|
175
|
+
const text = readFileIfPresentSync(path.join(contentDir, ...SYNDICATION_TARGETS_FILE.split('/')));
|
|
176
|
+
return text === undefined ? [] : parseSyndicationTargets(text).problems;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The declared targets a post selects, in the order the site declares them,
|
|
180
|
+
* each with its `url` filled for the post: those its `syndicate-to` names, and
|
|
181
|
+
* those whose tag it carries. An id nobody declared selects nothing.
|
|
182
|
+
*
|
|
183
|
+
* The post's language is its own `lang`, else `siteLanguage` (TASK-156). A
|
|
184
|
+
* target that lists `languages` is selected only for a post in one of them or
|
|
185
|
+
* in a regional form of one, so `de-AT` goes to a target that lists `de`, and
|
|
186
|
+
* {@link LANGUAGE_PLACEHOLDER} takes the listed tag; without a list it takes
|
|
187
|
+
* the post's. The one place the URL is decided, so the theme's link, the
|
|
188
|
+
* webmention and the stored copy's key cannot disagree.
|
|
189
|
+
*/
|
|
190
|
+
export function selectedTargets(document, targets, siteLanguage) {
|
|
191
|
+
const listed = new Set(stringsOf(document.extra[SYNDICATE_TO_FRONT_MATTER_KEY]));
|
|
192
|
+
const tags = new Set(document.tags.map((tag) => tag.toLowerCase()));
|
|
193
|
+
const language = documentLanguage(document) ?? canonicalLocale(siteLanguage) ?? DEFAULT_LOCALE;
|
|
194
|
+
return targets.flatMap((target) => {
|
|
195
|
+
const selected = listed.has(target.id) || (target.tag !== undefined && tags.has(target.tag.toLowerCase()));
|
|
196
|
+
if (!selected)
|
|
197
|
+
return [];
|
|
198
|
+
const filled = target.languages === undefined ? language : matchingLanguage(language, target.languages);
|
|
199
|
+
if (filled === undefined)
|
|
200
|
+
return [];
|
|
201
|
+
if (!target.url.includes(LANGUAGE_PLACEHOLDER))
|
|
202
|
+
return [target];
|
|
203
|
+
const url = webUrl(fillLanguage(target.url, filled));
|
|
204
|
+
return url === undefined ? [] : [{ ...target, url }];
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/** The first of `languages` that `language` is, or is a regional form of. */
|
|
208
|
+
function matchingLanguage(language, languages) {
|
|
209
|
+
const wanted = language.toLowerCase();
|
|
210
|
+
return languages.find((tag) => {
|
|
211
|
+
const listed = tag.toLowerCase();
|
|
212
|
+
return wanted === listed || wanted.startsWith(`${listed}-`);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function fillLanguage(template, language) {
|
|
216
|
+
return template.replaceAll(LANGUAGE_PLACEHOLDER, encodeURIComponent(language));
|
|
217
|
+
}
|
|
218
|
+
/** The ids a post's `syndicate-to` lists, as written. */
|
|
219
|
+
export function syndicateToOf(extra) {
|
|
220
|
+
return stringsOf(extra[SYNDICATE_TO_FRONT_MATTER_KEY]);
|
|
221
|
+
}
|
|
222
|
+
/** The copies an author listed by hand under `syndication`, each an http or https URL. */
|
|
223
|
+
export function handSyndicationOf(extra) {
|
|
224
|
+
return stringsOf(extra[SYNDICATION_FRONT_MATTER_KEY]).flatMap((value) => webUrl(value) ?? []);
|
|
225
|
+
}
|
|
226
|
+
/** The copies file of one content directory. */
|
|
227
|
+
export function syndicationCopies(contentDir) {
|
|
228
|
+
const file = path.join(contentDir, ...SYNDICATION_FILE.split('/'));
|
|
229
|
+
let cachedText;
|
|
230
|
+
let cached = {};
|
|
231
|
+
function readAll() {
|
|
232
|
+
const text = readFileIfPresentSync(file);
|
|
233
|
+
if (text === undefined) {
|
|
234
|
+
cachedText = undefined;
|
|
235
|
+
cached = {};
|
|
236
|
+
}
|
|
237
|
+
else if (text !== cachedText) {
|
|
238
|
+
cachedText = text;
|
|
239
|
+
cached = parseCopies(text);
|
|
240
|
+
}
|
|
241
|
+
return cached;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Change the file under its lock, and write it only when something changed:
|
|
245
|
+
* a resend that gets the same copy back must not churn a file that is in the
|
|
246
|
+
* site's git history.
|
|
247
|
+
*/
|
|
248
|
+
function update(change) {
|
|
249
|
+
return withFileLock(file, () => {
|
|
250
|
+
const current = readFileIfPresentSync(file);
|
|
251
|
+
const all = current === undefined ? {} : parseCopies(current);
|
|
252
|
+
if (change(all))
|
|
253
|
+
writeFileAtomicallySync(file, `${JSON.stringify(all, null, 2)}\n`);
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
read(permalink) {
|
|
258
|
+
return readAll()[permalink] ?? {};
|
|
259
|
+
},
|
|
260
|
+
write(permalink, target, copy) {
|
|
261
|
+
return update((all) => {
|
|
262
|
+
const copies = { ...all[permalink] };
|
|
263
|
+
if (copies[target] === copy)
|
|
264
|
+
return false;
|
|
265
|
+
if (copy === undefined)
|
|
266
|
+
delete copies[target];
|
|
267
|
+
else
|
|
268
|
+
copies[target] = copy;
|
|
269
|
+
if (Object.keys(copies).length === 0)
|
|
270
|
+
delete all[permalink];
|
|
271
|
+
else
|
|
272
|
+
all[permalink] = copies;
|
|
273
|
+
return true;
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
forget(permalink) {
|
|
277
|
+
return update((all) => {
|
|
278
|
+
if (!(permalink in all))
|
|
279
|
+
return false;
|
|
280
|
+
delete all[permalink];
|
|
281
|
+
return true;
|
|
282
|
+
});
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* The copies file's entries, each checked, since a person may edit it by hand.
|
|
288
|
+
* An entry that is not a URL is dropped rather than failing a render.
|
|
289
|
+
*/
|
|
290
|
+
function parseCopies(text) {
|
|
291
|
+
let parsed;
|
|
292
|
+
try {
|
|
293
|
+
parsed = JSON.parse(text);
|
|
294
|
+
}
|
|
295
|
+
catch {
|
|
296
|
+
return {};
|
|
297
|
+
}
|
|
298
|
+
if (!isRecord(parsed))
|
|
299
|
+
return {};
|
|
300
|
+
const all = {};
|
|
301
|
+
for (const [permalink, value] of Object.entries(parsed)) {
|
|
302
|
+
if (!isRecord(value))
|
|
303
|
+
continue;
|
|
304
|
+
const copies = {};
|
|
305
|
+
for (const [target, copy] of Object.entries(value)) {
|
|
306
|
+
const href = webUrl(copy);
|
|
307
|
+
if (href !== undefined)
|
|
308
|
+
copies[target] = href;
|
|
309
|
+
}
|
|
310
|
+
if (Object.keys(copies).length > 0)
|
|
311
|
+
all[permalink] = copies;
|
|
312
|
+
}
|
|
313
|
+
return all;
|
|
314
|
+
}
|
|
315
|
+
/** A front matter value as a list of strings: a lone string is a list of one. */
|
|
316
|
+
function stringsOf(value) {
|
|
317
|
+
if (typeof value === 'string')
|
|
318
|
+
return value === '' ? [] : [value];
|
|
319
|
+
if (!Array.isArray(value))
|
|
320
|
+
return [];
|
|
321
|
+
return value.filter((item) => typeof item === 'string' && item !== '');
|
|
322
|
+
}
|
|
323
|
+
function webUrl(value) {
|
|
324
|
+
if (typeof value !== 'string')
|
|
325
|
+
return undefined;
|
|
326
|
+
try {
|
|
327
|
+
const url = new URL(value);
|
|
328
|
+
return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : undefined;
|
|
329
|
+
}
|
|
330
|
+
catch {
|
|
331
|
+
return undefined;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function isRecord(value) {
|
|
335
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
336
|
+
}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