@geekity/cms 0.19.0 → 0.21.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 +3 -0
- package/admin/components/admin-bar.njk +4 -3
- package/admin/layouts/shell.njk +1 -0
- package/admin/pages/documents/editor.njk +34 -0
- package/admin/static/admin.css +87 -0
- package/admin/static/location.js +38 -0
- package/dist/admin/comments.js +3 -1
- package/dist/admin/comments.js.map +1 -1
- package/dist/admin/documents.d.ts +13 -0
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +107 -34
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/editor-layout.d.ts.map +1 -1
- package/dist/admin/editor-layout.js +1 -0
- package/dist/admin/editor-layout.js.map +1 -1
- package/dist/admin/federation.d.ts +3 -1
- package/dist/admin/federation.d.ts.map +1 -1
- package/dist/admin/federation.js +6 -4
- package/dist/admin/federation.js.map +1 -1
- package/dist/admin/headers.d.ts +1 -0
- package/dist/admin/headers.d.ts.map +1 -1
- package/dist/admin/headers.js +3 -0
- package/dist/admin/headers.js.map +1 -1
- package/dist/admin/media.d.ts.map +1 -1
- package/dist/admin/media.js +3 -0
- package/dist/admin/media.js.map +1 -1
- package/dist/admin/preview.d.ts.map +1 -1
- package/dist/admin/preview.js +1 -1
- package/dist/admin/preview.js.map +1 -1
- package/dist/admin/routes.js +1 -1
- package/dist/admin/routes.js.map +1 -1
- package/dist/comments/routes.d.ts.map +1 -1
- package/dist/comments/routes.js +1 -0
- package/dist/comments/routes.js.map +1 -1
- package/dist/comments/submission.d.ts +2 -0
- package/dist/comments/submission.d.ts.map +1 -1
- package/dist/comments/submission.js +1 -1
- package/dist/comments/submission.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/content/citation.d.ts +18 -0
- package/dist/content/citation.d.ts.map +1 -1
- package/dist/content/citation.js +33 -0
- package/dist/content/citation.js.map +1 -1
- package/dist/content/markdown.d.ts +9 -0
- package/dist/content/markdown.d.ts.map +1 -1
- package/dist/content/markdown.js +37 -1
- package/dist/content/markdown.js.map +1 -1
- package/dist/content/post-type.d.ts +3 -7
- package/dist/content/post-type.d.ts.map +1 -1
- package/dist/content/post-type.js +39 -17
- package/dist/content/post-type.js.map +1 -1
- package/dist/content/slug.d.ts +2 -1
- package/dist/content/slug.d.ts.map +1 -1
- package/dist/content/slug.js +3 -1
- package/dist/content/slug.js.map +1 -1
- package/dist/env.d.ts +6 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/federation/article.d.ts +4 -4
- package/dist/federation/article.d.ts.map +1 -1
- package/dist/federation/article.js +19 -21
- package/dist/federation/article.js.map +1 -1
- package/dist/federation/delivery.d.ts +10 -0
- package/dist/federation/delivery.d.ts.map +1 -1
- package/dist/federation/delivery.js +48 -4
- package/dist/federation/delivery.js.map +1 -1
- package/dist/federation/federation.d.ts +3 -0
- package/dist/federation/federation.d.ts.map +1 -1
- package/dist/federation/federation.js.map +1 -1
- package/dist/federation/mount.js +1 -0
- package/dist/federation/mount.js.map +1 -1
- package/dist/federation/relays.d.ts +2 -0
- package/dist/federation/relays.d.ts.map +1 -1
- package/dist/federation/relays.js +1 -0
- package/dist/federation/relays.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -3
- package/dist/index.js.map +1 -1
- package/dist/micropub/content.d.ts +15 -0
- package/dist/micropub/content.d.ts.map +1 -0
- package/dist/micropub/content.js +254 -0
- package/dist/micropub/content.js.map +1 -0
- package/dist/micropub/create.d.ts.map +1 -1
- package/dist/micropub/create.js +13 -8
- package/dist/micropub/create.js.map +1 -1
- package/dist/micropub/endpoint.d.ts.map +1 -1
- package/dist/micropub/endpoint.js +18 -4
- package/dist/micropub/endpoint.js.map +1 -1
- package/dist/notifications/comments.d.ts +2 -0
- package/dist/notifications/comments.d.ts.map +1 -1
- package/dist/notifications/comments.js +1 -1
- package/dist/notifications/comments.js.map +1 -1
- package/dist/notifications/digest.d.ts +2 -0
- package/dist/notifications/digest.d.ts.map +1 -1
- package/dist/notifications/digest.js +1 -1
- package/dist/notifications/digest.js.map +1 -1
- package/dist/web/admin-bar.js +2 -1
- package/dist/web/admin-bar.js.map +1 -1
- package/dist/web/archive.d.ts +2 -1
- package/dist/web/archive.d.ts.map +1 -1
- package/dist/web/archive.js +2 -2
- package/dist/web/archive.js.map +1 -1
- package/dist/web/context.d.ts +13 -6
- package/dist/web/context.d.ts.map +1 -1
- package/dist/web/context.js +14 -4
- package/dist/web/context.js.map +1 -1
- package/dist/web/conversation.d.ts +2 -0
- package/dist/web/conversation.d.ts.map +1 -1
- package/dist/web/conversation.js +1 -1
- package/dist/web/conversation.js.map +1 -1
- package/dist/web/feed-item.d.ts +26 -3
- package/dist/web/feed-item.d.ts.map +1 -1
- package/dist/web/feed-item.js +57 -6
- package/dist/web/feed-item.js.map +1 -1
- package/dist/web/feed-rss.js +3 -3
- package/dist/web/feed-rss.js.map +1 -1
- package/dist/web/feed-source.d.ts +7 -0
- package/dist/web/feed-source.d.ts.map +1 -1
- package/dist/web/feed-source.js.map +1 -1
- package/dist/web/feeds.d.ts.map +1 -1
- package/dist/web/feeds.js +14 -2
- package/dist/web/feeds.js.map +1 -1
- package/dist/web/negotiate.d.ts +4 -0
- package/dist/web/negotiate.d.ts.map +1 -1
- package/dist/web/negotiate.js +5 -1
- package/dist/web/negotiate.js.map +1 -1
- package/dist/web/oembed.d.ts +1 -0
- package/dist/web/oembed.d.ts.map +1 -1
- package/dist/web/oembed.js +3 -5
- package/dist/web/oembed.js.map +1 -1
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +30 -15
- package/dist/web/render.js.map +1 -1
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +7 -4
- package/dist/web/routes.js.map +1 -1
- package/dist/web/sanitize.d.ts +10 -0
- package/dist/web/sanitize.d.ts.map +1 -1
- package/dist/web/sanitize.js +180 -0
- package/dist/web/sanitize.js.map +1 -1
- package/dist/web/templates.d.ts.map +1 -1
- package/dist/web/templates.js +2 -0
- package/dist/web/templates.js.map +1 -1
- package/dist/webmention/cited-picture.d.ts +36 -0
- package/dist/webmention/cited-picture.d.ts.map +1 -0
- package/dist/webmention/cited-picture.js +118 -0
- package/dist/webmention/cited-picture.js.map +1 -0
- package/dist/webmention/fetch-public.d.ts +23 -7
- package/dist/webmention/fetch-public.d.ts.map +1 -1
- package/dist/webmention/fetch-public.js +6 -2
- package/dist/webmention/fetch-public.js.map +1 -1
- package/dist/webmention/reply-context.d.ts +17 -8
- package/dist/webmention/reply-context.d.ts.map +1 -1
- package/dist/webmention/reply-context.js +140 -28
- package/dist/webmention/reply-context.js.map +1 -1
- package/dist/webmention/reply-contexts.d.ts +13 -2
- package/dist/webmention/reply-contexts.d.ts.map +1 -1
- package/dist/webmention/reply-contexts.js +82 -6
- package/dist/webmention/reply-contexts.js.map +1 -1
- package/package.json +3 -2
- package/themes/default/README.md +60 -5
- package/themes/default/layouts/post.njk +2 -1
- package/themes/default/partials/citations.njk +14 -2
- package/themes/default/partials/cited-page.njk +21 -4
- package/themes/default/partials/reply-context.njk +7 -2
- package/themes/default/src/style.css +37 -0
- package/themes/default/static/style.css +83 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reply-contexts.d.ts","sourceRoot":"","sources":["../../src/webmention/reply-contexts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"reply-contexts.d.ts","sourceRoot":"","sources":["../../src/webmention/reply-contexts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,kBAAkB,EAA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,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,gCAAgC,GACxC,mBAAmB,CAkKrB"}
|
|
@@ -3,6 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
import { citationsOf } from '../content/citation.js';
|
|
4
4
|
import { replyTarget } from '../content/post-type.js';
|
|
5
5
|
import { updateFileAtomically } from '../files/atomic.js';
|
|
6
|
+
import { copyCitedPicture, parseCitedPicture, sweepCitedPictures } from './cited-picture.js';
|
|
6
7
|
import { fetchReplyContext } from './reply-context.js';
|
|
7
8
|
/**
|
|
8
9
|
* Where the fetched contexts are kept, relative to the content directory: one
|
|
@@ -10,11 +11,12 @@ import { fetchReplyContext } from './reply-context.js';
|
|
|
10
11
|
* (decision-19). Eleventy reads it as the `replyContexts` global.
|
|
11
12
|
*/
|
|
12
13
|
export const REPLY_CONTEXTS_FILE = '_data/replyContexts.json';
|
|
14
|
+
export const CITED_SLUG_TIMEOUT_MS = 3_000;
|
|
13
15
|
/** Build the reply context service for one site. */
|
|
14
16
|
export function createReplyContextService(options) {
|
|
15
|
-
const { store, lookup } = options;
|
|
17
|
+
const { store, lookup, config } = options;
|
|
16
18
|
const logger = options.logger ?? console;
|
|
17
|
-
const file = path.join(
|
|
19
|
+
const file = path.join(config.contentDir, ...REPLY_CONTEXTS_FILE.split('/'));
|
|
18
20
|
let cachedText;
|
|
19
21
|
let cached = {};
|
|
20
22
|
/** The whole file, parsed only when its bytes changed since the last read. */
|
|
@@ -36,14 +38,33 @@ export function createReplyContextService(options) {
|
|
|
36
38
|
}
|
|
37
39
|
/** Rewrite the file with one target's entry set, or removed when `undefined`. */
|
|
38
40
|
async function write(target, context) {
|
|
41
|
+
let previous;
|
|
39
42
|
await updateFileAtomically(file, (current) => {
|
|
40
43
|
const all = current === undefined ? {} : parseContexts(current);
|
|
44
|
+
previous = all[target];
|
|
41
45
|
if (context === undefined)
|
|
42
46
|
delete all[target];
|
|
43
47
|
else
|
|
44
48
|
all[target] = context;
|
|
45
49
|
return `${JSON.stringify(all, null, 2)}\n`;
|
|
46
50
|
});
|
|
51
|
+
if (context !== undefined)
|
|
52
|
+
options.onStored?.(target, previous);
|
|
53
|
+
}
|
|
54
|
+
async function withPicture(context, source) {
|
|
55
|
+
const picture = source === undefined ? undefined : await copyCitedPicture(source, { lookup, config });
|
|
56
|
+
if (source !== undefined && picture === undefined) {
|
|
57
|
+
logger.warn(`Could not copy ${source.url}, the picture of ${context.url}`);
|
|
58
|
+
}
|
|
59
|
+
return picture === undefined ? context : { ...context, picture };
|
|
60
|
+
}
|
|
61
|
+
async function sweep() {
|
|
62
|
+
const kept = new Set();
|
|
63
|
+
for (const context of Object.values(readAll())) {
|
|
64
|
+
if (context.picture !== undefined)
|
|
65
|
+
kept.add(context.picture.src);
|
|
66
|
+
}
|
|
67
|
+
await sweepCitedPictures(config, kept);
|
|
47
68
|
}
|
|
48
69
|
async function refresh(target) {
|
|
49
70
|
const fetched = await fetchReplyContext(target, { lookup });
|
|
@@ -51,16 +72,31 @@ export function createReplyContextService(options) {
|
|
|
51
72
|
logger.warn(`Could not read ${target} for a citation's context: ${fetched.reason}`);
|
|
52
73
|
return;
|
|
53
74
|
}
|
|
54
|
-
await
|
|
75
|
+
const context = await withPicture(fetched.context, fetched.picture);
|
|
76
|
+
if (hasNoPictureOrWords(context))
|
|
77
|
+
return;
|
|
78
|
+
await write(target, context);
|
|
79
|
+
await sweep();
|
|
80
|
+
}
|
|
81
|
+
async function attachPicture(target, source) {
|
|
82
|
+
const held = readAll()[target];
|
|
83
|
+
if (held === undefined || held.picture !== undefined)
|
|
84
|
+
return;
|
|
85
|
+
const context = await withPicture(held, source);
|
|
86
|
+
if (context.picture !== undefined && readAll()[target] !== undefined) {
|
|
87
|
+
await write(target, context);
|
|
88
|
+
}
|
|
55
89
|
}
|
|
56
|
-
/** Forget a target, unless a post still cites it. */
|
|
57
90
|
async function forget(target) {
|
|
58
91
|
if (!(target in readAll()))
|
|
59
92
|
return;
|
|
60
93
|
const stillCited = store.listAll().some((document) => targetsOf(document).includes(target));
|
|
61
|
-
if (
|
|
62
|
-
|
|
94
|
+
if (stillCited)
|
|
95
|
+
return;
|
|
96
|
+
await write(target, undefined);
|
|
97
|
+
await sweep();
|
|
63
98
|
}
|
|
99
|
+
const describedForSave = new Set();
|
|
64
100
|
let chain = Promise.resolve();
|
|
65
101
|
function enqueue(task) {
|
|
66
102
|
chain = chain.then(task).catch((thrown) => {
|
|
@@ -77,6 +113,8 @@ export function createReplyContextService(options) {
|
|
|
77
113
|
// target that changed as well.
|
|
78
114
|
for (const target of after) {
|
|
79
115
|
const changed = !before.includes(target) && change.origin !== 'scan';
|
|
116
|
+
if (describedForSave.delete(target) && target in held)
|
|
117
|
+
continue;
|
|
80
118
|
if (!(target in held) || changed)
|
|
81
119
|
enqueue(() => refresh(target));
|
|
82
120
|
}
|
|
@@ -96,6 +134,34 @@ export function createReplyContextService(options) {
|
|
|
96
134
|
}
|
|
97
135
|
for (const target of missing)
|
|
98
136
|
enqueue(() => refresh(target));
|
|
137
|
+
enqueue(sweep);
|
|
138
|
+
},
|
|
139
|
+
async describe(target) {
|
|
140
|
+
const held = readAll()[target];
|
|
141
|
+
if (held !== undefined)
|
|
142
|
+
return held;
|
|
143
|
+
const deadline = Date.now() + CITED_SLUG_TIMEOUT_MS;
|
|
144
|
+
const fetched = await fetchReplyContext(target, { lookup, timeoutMs: CITED_SLUG_TIMEOUT_MS });
|
|
145
|
+
if (!fetched.ok)
|
|
146
|
+
return undefined;
|
|
147
|
+
const { picture } = fetched;
|
|
148
|
+
if (hasNoPictureOrWords(fetched.context)) {
|
|
149
|
+
const timeoutMs = deadline - Date.now();
|
|
150
|
+
const copied = picture === undefined || timeoutMs <= 0
|
|
151
|
+
? undefined
|
|
152
|
+
: await copyCitedPicture(picture, { lookup, config, timeoutMs });
|
|
153
|
+
if (copied === undefined)
|
|
154
|
+
return undefined;
|
|
155
|
+
const context = { ...fetched.context, picture: copied };
|
|
156
|
+
await write(target, context);
|
|
157
|
+
describedForSave.add(target);
|
|
158
|
+
return context;
|
|
159
|
+
}
|
|
160
|
+
await write(target, fetched.context);
|
|
161
|
+
describedForSave.add(target);
|
|
162
|
+
if (picture !== undefined)
|
|
163
|
+
enqueue(() => attachPicture(target, picture));
|
|
164
|
+
return fetched.context;
|
|
99
165
|
},
|
|
100
166
|
read(target) {
|
|
101
167
|
return readAll()[target];
|
|
@@ -105,6 +171,13 @@ export function createReplyContextService(options) {
|
|
|
105
171
|
},
|
|
106
172
|
};
|
|
107
173
|
}
|
|
174
|
+
function hasNoPictureOrWords(context) {
|
|
175
|
+
return (context.picture === undefined &&
|
|
176
|
+
context.name === undefined &&
|
|
177
|
+
context.text === undefined &&
|
|
178
|
+
context.author === undefined &&
|
|
179
|
+
context.site === undefined);
|
|
180
|
+
}
|
|
108
181
|
function targetsOf(document) {
|
|
109
182
|
if (document === undefined)
|
|
110
183
|
return [];
|
|
@@ -136,6 +209,7 @@ function parseContexts(text) {
|
|
|
136
209
|
const author = isRecord(value['author']) ? value['author'] : undefined;
|
|
137
210
|
const authorName = stringOf(author?.['name']);
|
|
138
211
|
const authorUrl = webUrlOf(author?.['url']);
|
|
212
|
+
const picture = parseCitedPicture(value['picture']);
|
|
139
213
|
contexts[target] = {
|
|
140
214
|
url: target,
|
|
141
215
|
...optional('name', stringOf(value['name'])),
|
|
@@ -144,6 +218,8 @@ function parseContexts(text) {
|
|
|
144
218
|
? {}
|
|
145
219
|
: { author: { name: authorName, ...optional('url', authorUrl) } }),
|
|
146
220
|
...optional('published', stringOf(value['published'])),
|
|
221
|
+
...optional('site', stringOf(value['site'])),
|
|
222
|
+
...(picture === undefined ? {} : { picture }),
|
|
147
223
|
};
|
|
148
224
|
}
|
|
149
225
|
return contexts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reply-contexts.js","sourceRoot":"","sources":["../../src/webmention/reply-contexts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,O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,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekity/cms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A file-first CMS: Markdown content, a SQLite index, a Hono server that is both the editor and the public site.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"markdown-it-footnote": "^4.0.0",
|
|
42
42
|
"nodemailer": "^10.0.13",
|
|
43
43
|
"nunjucks": "^3.2.4",
|
|
44
|
-
"sharp": "^0.35.5"
|
|
44
|
+
"sharp": "^0.35.5",
|
|
45
|
+
"turndown": "^7.2.4"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@11ty/eleventy": "^3.1.6",
|
package/themes/default/README.md
CHANGED
|
@@ -386,7 +386,10 @@ copies elsewhere (`syndication`) after **Also on**. A page never prints either,
|
|
|
386
386
|
and its line is a `p.page-meta` rather than a `p.entry-meta`.
|
|
387
387
|
|
|
388
388
|
**Every post's page has one `h1`.** A post with a name of its own is headed by
|
|
389
|
-
it, as above.
|
|
389
|
+
it, as above. So is a post with a title and no words, such as a titled like,
|
|
390
|
+
repost or bookmark (TASK-256): its header comes first and its citation after
|
|
391
|
+
it. A title that only repeats a post's opening words is no name. A note, or a
|
|
392
|
+
reply without a title, opens on its words instead,
|
|
390
393
|
set larger, so it has no `header`; in its place is an `h1` a screen reader and
|
|
391
394
|
a crawler navigate by and a sighted reader never sees, saying what the post is,
|
|
392
395
|
who wrote it and when, and then the kicker:
|
|
@@ -422,8 +425,14 @@ inside the `h-entry` wherever it is printed.
|
|
|
422
425
|
Reposted, Liked or Bookmarked and links the target as its `u-url`. The link
|
|
423
426
|
says the target's name, as the reply context does, with its author after it as
|
|
424
427
|
a `p-author h-card`, when the target was read when the post was saved
|
|
425
|
-
(TASK-244): its `h-entry` name, its oEmbed title, or its
|
|
426
|
-
|
|
428
|
+
(TASK-244): its `h-entry` name, its oEmbed title, or its `og:title` or
|
|
429
|
+
`<title>`. A YouTube, TikTok, Reddit or Giphy target is named by that
|
|
430
|
+
provider's known oEmbed endpoint, asked before its page, which is read only
|
|
431
|
+
when the endpoint names nothing (TASK-251, TASK-253). Any other target's oEmbed
|
|
432
|
+
title comes from the endpoint its page links. A title that is only a site suffix such as "- YouTube" is
|
|
433
|
+
no title. With only an author it says "a post", and with neither "a page on"
|
|
434
|
+
the target's host, never the bare URL, which can run to hundreds of
|
|
435
|
+
characters: "Bookmarked a page on example.com" (TASK-255). Its kicker
|
|
427
436
|
and its hidden `h1` say Repost, Like or Bookmark. It is placed as the reply
|
|
428
437
|
context is: at the top of an untitled post, after the header of a titled one.
|
|
429
438
|
A listing cites each entry's from the same partial, by the same rule.
|
|
@@ -436,7 +445,48 @@ as its author. The title link stops before " by ", and the words after it
|
|
|
436
445
|
become the `p-author h-card`, so the line reads "Liked Flickermood by Forss"
|
|
437
446
|
and a parser still reads the whole title as the `p-name`. A name that mentions
|
|
438
447
|
its author anywhere else, such as "Rick Astley - Never Gonna Give You Up" by
|
|
439
|
-
Rick Astley, keeps the author after it.
|
|
448
|
+
Rick Astley, keeps the author after it. A page that names no author but names
|
|
449
|
+
its site, its `og:site_name`, is followed by a middle dot and the site as a
|
|
450
|
+
plain `span.cite-site`, never an `h-card`, because a site is not an author: a
|
|
451
|
+
bookmark of a Scripting News post reads "Bookmarked RSS tip #2 · Scripting
|
|
452
|
+
News". A like's, a repost's or a bookmark's citation never prints the page's
|
|
453
|
+
description, which on many sites describes the site rather than the post.
|
|
454
|
+
|
|
455
|
+
**A citation shows the cited page's picture** (TASK-252) when the page named
|
|
456
|
+
one and the post has not removed its preview. The picture is the page's
|
|
457
|
+
oEmbed photo, else its oEmbed thumbnail, else its `og:image`, else its
|
|
458
|
+
`twitter:image`, copied into the site's uploads when the post was saved, so
|
|
459
|
+
a reader's browser never asks the cited site or its CDN for anything. It is
|
|
460
|
+
`context.picture`: `{ src, width, height, kind, video, shownInFull, imgHtml }`, where
|
|
461
|
+
`imgHtml` is an `img.u-photo` inside the `h-cite`, responsive when the copy has
|
|
462
|
+
variants. A repost of a photo (`shownInFull`, such as a Giphy GIF) prints it in full
|
|
463
|
+
under the line, as `a.cite-photo` linking to the target, with the target's
|
|
464
|
+
name as its alt text. Every other citation with a picture (a like, a bookmark,
|
|
465
|
+
a reply, a repost of a video or a page) is classed `cite-with-thumb` and
|
|
466
|
+
prints it as `a.cite-thumb` beside the line: a 6rem thumbnail linking to the
|
|
467
|
+
target, out of the tab order and hidden from assistive technology because the
|
|
468
|
+
title beside it is the same link, with an empty alt text. A video's thumbnail
|
|
469
|
+
is also classed `cite-video`, which the stylesheet draws a play mark on. A
|
|
470
|
+
picture that could not be copied, was bigger than the site's upload limit or
|
|
471
|
+
was never named leaves the citation as it was, with no picture. A post whose
|
|
472
|
+
front matter says `preview: false`, which the editor's remove control writes,
|
|
473
|
+
prints the plain citation, and so do its listing entry and its feed items.
|
|
474
|
+
There is never an iframe or a script from the cited page.
|
|
475
|
+
|
|
476
|
+
**A cited URL that is itself an image** (TASK-255), one that answers with an
|
|
477
|
+
`image/*` type rather than a page, is copied as its own picture of kind
|
|
478
|
+
`photo` and has no name, so `context.image` is true and the line says "an
|
|
479
|
+
image from" its host as the link: "Reposted an image from edu.casio.com". A
|
|
480
|
+
repost shows it in full like a reposted GIF, a like or a bookmark as a
|
|
481
|
+
thumbnail beside "Liked an image from edu.casio.com", and a post that hid its
|
|
482
|
+
preview still says it reposted an image. Its alt text is the post's
|
|
483
|
+
`cited-alt`, which the editor's card writes, else the post's title, else
|
|
484
|
+
empty. An image that could not be copied, or was bigger than the site's
|
|
485
|
+
upload limit, keeps no context, so its citation says "a page on" its host.
|
|
486
|
+
|
|
487
|
+
The feeds open each
|
|
488
|
+
citing post's HTML with the same citation as a `p.cite-line`, the picture
|
|
489
|
+
after it with an absolute `src`.
|
|
440
490
|
|
|
441
491
|
**A read says what was read** (TASK-229) with `partials/read.njk`, a
|
|
442
492
|
`p.read-line` at the top of the `e-content` that reads like indiebookclub's
|
|
@@ -625,7 +675,8 @@ its kicker:
|
|
|
625
675
|
whole as its `e-content`, and the date in its kicker is its `u-url`. A reply is
|
|
626
676
|
a note that first cites what it answers with `partials/reply-context.njk`, and
|
|
627
677
|
a reply with a title is an article that cites it after its title and summary.
|
|
628
|
-
A like, a repost and a bookmark place `partials/citations.njk` the same way
|
|
678
|
+
A like, a repost and a bookmark place `partials/citations.njk` the same way,
|
|
679
|
+
and one with a title and no words is listed by its title too. An article's categories are in
|
|
629
680
|
its kicker; a note's are on its own page.
|
|
630
681
|
|
|
631
682
|
The excerpt is the entry's `summary`, the very line the feeds publish, so a
|
|
@@ -907,6 +958,10 @@ IndieWeb. The graph holds:
|
|
|
907
958
|
`author`, and the site's `publisher`: the site author's Person, or the
|
|
908
959
|
Organization. A post with no title is headed by the words its `<title>`
|
|
909
960
|
names it by, its `label`, cut on a word boundary to at most 110 characters.
|
|
961
|
+
A post with no words either is labelled by what it is (TASK-261): "Liked",
|
|
962
|
+
"Reposted", "Bookmarked" or "Reply to" and the cited page's stored title,
|
|
963
|
+
else the host its citation line names ("Liked a page on www.youtube.com"), and
|
|
964
|
+
"Photo" for a photo post. "Untitled" is the last fallback.
|
|
910
965
|
Its `image` is the picture the Open Graph tags print, so the two always
|
|
911
966
|
agree (see [The head](#the-head)). Its `license` is the page's license URL,
|
|
912
967
|
the front matter's over the site's, and absent with none.
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
a kicker that names its kind (Article, Note, Reply) and the categories it is
|
|
4
4
|
filed under.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
A post with a title its words do not open with (an article, a titled reply,
|
|
7
|
+
a titled like with no words at all) has the only headline: the title as its
|
|
7
8
|
`p-name` and the author's `description` under it as the deck, a
|
|
8
9
|
`p-summary`. A post with no title opens on its words, set larger. What a
|
|
9
10
|
reply answers, and what a like, repost or bookmark cites, opens a post with
|
|
@@ -12,15 +12,27 @@
|
|
|
12
12
|
`context` is what the target said about itself when the post was saved or
|
|
13
13
|
synced (TASK-244), only when it said something: its `name` and `author`,
|
|
14
14
|
printed through autoescaping like a reply's context. With a name, the name
|
|
15
|
-
is the link; with only an author, "a post" is;
|
|
15
|
+
is the link; with only an author, "a post" is; for a URL that is an image,
|
|
16
|
+
"an image from" its host; with nothing, "a page on" its host.
|
|
17
|
+
|
|
18
|
+
`context.picture` is the target's picture, copied into the site's uploads
|
|
19
|
+
(TASK-252), absent when there is none or the post hid its previews. A
|
|
20
|
+
repost of a photo (`picture.shownInFull`) shows it in full under the line; any
|
|
21
|
+
other citation shows it as a thumbnail beside the line. Both link to the
|
|
22
|
+
target, and `picture.imgHtml` is the `img.u-photo` inside the `h-cite`.
|
|
16
23
|
#}
|
|
17
24
|
{% import "partials/cited-page.njk" as cited %}
|
|
18
25
|
{% set citationVerbs = { "repost-of": "Reposted", "like-of": "Liked", "bookmark-of": "Bookmarked" } %}
|
|
19
26
|
{% for citation in citations %}
|
|
20
27
|
{% set citedPage = citation.context %}
|
|
21
|
-
|
|
28
|
+
{% set picture = citedPage.picture %}
|
|
29
|
+
<div class="reply-context cite u-{{ citation.property }} h-cite{% if picture and not picture.shownInFull %} cite-with-thumb{% endif %}">
|
|
30
|
+
{%- if picture and not picture.shownInFull %}{{ cited.thumb(citation.url, picture) }}{% endif %}
|
|
22
31
|
<p class="cite-line small">{{ citationVerbs[citation.property] }}
|
|
23
32
|
{{- cited.page(citation.url, citedPage) -}}
|
|
24
33
|
</p>
|
|
34
|
+
{%- if picture.shownInFull %}
|
|
35
|
+
<a class="cite-photo" href="{{ citation.url }}">{{ picture.imgHtml | safe }}</a>
|
|
36
|
+
{%- endif %}
|
|
25
37
|
</div>
|
|
26
38
|
{% endfor %}
|
|
@@ -8,14 +8,25 @@
|
|
|
8
8
|
|
|
9
9
|
`url` is the cited page, always its `u-url`. `context` is what the page said
|
|
10
10
|
about itself, from the reply contexts file. With a name, the name is the
|
|
11
|
-
link; with only an author, "a post" is;
|
|
12
|
-
|
|
11
|
+
link; with only an author, "a post" is; a URL that is itself an image
|
|
12
|
+
(`context.image`, TASK-255) is "an image from" its host; anything else is "a
|
|
13
|
+
page on" its host, never the bare URL, which can run to hundreds of
|
|
14
|
+
characters. The author follows as an `h-card`.
|
|
13
15
|
|
|
14
16
|
A name that already ends in " by " and the author's name, matched without
|
|
15
17
|
regard to case (SoundCloud's oEmbed gives "Flickermood by Forss" by Forss),
|
|
16
18
|
is not followed by the author again. Its last words become the `h-card`,
|
|
17
19
|
printed as the title wrote them, and the whole name stays the `p-name`, so a
|
|
18
20
|
parser reads the same name and author either way.
|
|
21
|
+
|
|
22
|
+
A page that names no author may name its site, `context.site` (its
|
|
23
|
+
`og:site_name`), printed after a middle dot as plain text: a site is not an
|
|
24
|
+
author, so it is no `h-card`.
|
|
25
|
+
|
|
26
|
+
`thumb(url, picture)` is a cited page's thumbnail (TASK-252): a link to the
|
|
27
|
+
page around `picture.imgHtml`, out of the tab order and hidden from assistive
|
|
28
|
+
technology because the title beside it is the same link. A video's carries
|
|
29
|
+
`cite-video`, which the stylesheet draws a play mark on.
|
|
19
30
|
#}
|
|
20
31
|
{% macro page(url, context) %}
|
|
21
32
|
{%- set title = (context.name or "") | trim -%}
|
|
@@ -27,12 +38,18 @@
|
|
|
27
38
|
{%- else %}
|
|
28
39
|
{%- if context.name %} <a class="u-url p-name" href="{{ url }}">{{ context.name }}</a>
|
|
29
40
|
{%- elif context.author %} <a class="u-url" href="{{ url }}">a post</a>
|
|
30
|
-
{%-
|
|
41
|
+
{%- elif context.image %} <a class="u-url" href="{{ url }}">an image from {{ url | host }}</a>
|
|
42
|
+
{%- else %} <a class="u-url" href="{{ url }}">a page on {{ url | host }}</a>
|
|
31
43
|
{%- endif %}
|
|
32
|
-
{%- if context.author %} by {{ card(context.author, context.author.name) }}
|
|
44
|
+
{%- if context.author %} by {{ card(context.author, context.author.name) }}
|
|
45
|
+
{%- elif context.site %} · <span class="cite-site">{{ context.site }}</span>{% endif %}
|
|
33
46
|
{%- endif %}
|
|
34
47
|
{%- endmacro %}
|
|
35
48
|
|
|
49
|
+
{% macro thumb(url, picture) -%}
|
|
50
|
+
<a class="cite-thumb{% if picture.video %} cite-video{% endif %}" href="{{ url }}" tabindex="-1" aria-hidden="true">{{ picture.imgHtml | safe }}</a>
|
|
51
|
+
{%- endmacro %}
|
|
52
|
+
|
|
36
53
|
{% macro card(author, name) -%}
|
|
37
54
|
<span class="p-author h-card">
|
|
38
55
|
{%- if author.url %}<a class="u-url p-name" href="{{ author.url }}">{{ name }}</a>
|
|
@@ -12,13 +12,18 @@
|
|
|
12
12
|
or synced: its name, a short excerpt, its author and its date, each only when
|
|
13
13
|
it said so. It is somebody else's words, so every piece is printed through
|
|
14
14
|
autoescaping and none of it with `safe`. With a name, the name is the link;
|
|
15
|
-
with only an author, "a post" is; with neither,
|
|
15
|
+
with only an author, "a post" is; with neither, "a page on" its host. Its date is
|
|
16
16
|
written in `lang`, the language of the entry it sits in (TASK-189), so a
|
|
17
17
|
listing sets `lang` from each entry as it sets `replyContext`.
|
|
18
|
+
|
|
19
|
+
`replyContext.picture`, when the target has one and the reply shows it, is
|
|
20
|
+
drawn as a thumbnail beside the line, as `citations.njk` draws it (TASK-252).
|
|
18
21
|
#}
|
|
19
22
|
{% import "partials/cited-page.njk" as cited %}
|
|
20
23
|
{% if inReplyTo %}
|
|
21
|
-
|
|
24
|
+
{% set picture = replyContext.picture %}
|
|
25
|
+
<div class="reply-context cite u-in-reply-to h-cite{% if picture %} cite-with-thumb{% endif %}">
|
|
26
|
+
{%- if picture %}{{ cited.thumb(inReplyTo, picture) }}{% endif %}
|
|
22
27
|
<p class="cite-line small">In reply to
|
|
23
28
|
{{- cited.page(inReplyTo, replyContext) }}
|
|
24
29
|
{%- if replyContext.published %}, <time class="dt-published" datetime="{{ replyContext.published | date("iso") }}">{{ replyContext.published | date("readable", none, lang) }}</time>
|
|
@@ -643,6 +643,43 @@
|
|
|
643
643
|
@apply mt-1 text-[0.98rem] leading-snug text-muted italic;
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
+
.cite-with-thumb {
|
|
647
|
+
@apply grid grid-cols-[6rem_minmax(0,1fr)] items-start gap-x-3;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.cite-with-thumb > :not(.cite-thumb) {
|
|
651
|
+
@apply col-start-2;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.cite-thumb {
|
|
655
|
+
@apply relative row-span-2 block;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.cite-thumb img {
|
|
659
|
+
@apply block aspect-[4/3] h-auto w-full rounded-sm object-cover;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.cite-video::before {
|
|
663
|
+
@apply absolute inset-0 m-auto size-9 rounded-full;
|
|
664
|
+
content: '';
|
|
665
|
+
background: rgb(0 0 0 / 0.65);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.cite-video::after {
|
|
669
|
+
@apply absolute inset-0 m-auto h-4 w-3.5 translate-x-[10%];
|
|
670
|
+
content: '';
|
|
671
|
+
background: #fff;
|
|
672
|
+
clip-path: polygon(0 0, 100% 50%, 0 100%);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
.cite-photo {
|
|
676
|
+
@apply mt-2 block;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.cite-photo img {
|
|
680
|
+
@apply block h-auto max-w-full rounded-sm;
|
|
681
|
+
}
|
|
682
|
+
|
|
646
683
|
/* One post or page: `article.blog-post.h-entry`. */
|
|
647
684
|
.post-header {
|
|
648
685
|
@apply mb-8;
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
--tw-font-weight: initial;
|
|
8
8
|
--tw-tracking: initial;
|
|
9
9
|
--tw-border-style: solid;
|
|
10
|
+
--tw-translate-x: 0;
|
|
11
|
+
--tw-translate-y: 0;
|
|
12
|
+
--tw-translate-z: 0;
|
|
10
13
|
--tw-space-y-reverse: 0;
|
|
11
14
|
--tw-shadow: 0 0 #0000;
|
|
12
15
|
--tw-shadow-color: initial;
|
|
@@ -1156,6 +1159,68 @@
|
|
|
1156
1159
|
font-style: italic;
|
|
1157
1160
|
}
|
|
1158
1161
|
|
|
1162
|
+
.cite-with-thumb {
|
|
1163
|
+
align-items: flex-start;
|
|
1164
|
+
column-gap: calc(var(--spacing) * 3);
|
|
1165
|
+
grid-template-columns: 6rem minmax(0, 1fr);
|
|
1166
|
+
display: grid;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
.cite-with-thumb > :not(.cite-thumb) {
|
|
1170
|
+
grid-column-start: 2;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
.cite-thumb {
|
|
1174
|
+
grid-row: span 2 / span 2;
|
|
1175
|
+
display: block;
|
|
1176
|
+
position: relative;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
.cite-thumb img {
|
|
1180
|
+
aspect-ratio: 4 / 3;
|
|
1181
|
+
border-radius: var(--radius-sm);
|
|
1182
|
+
object-fit: cover;
|
|
1183
|
+
width: 100%;
|
|
1184
|
+
height: auto;
|
|
1185
|
+
display: block;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.cite-video:before {
|
|
1189
|
+
width: calc(var(--spacing) * 9);
|
|
1190
|
+
height: calc(var(--spacing) * 9);
|
|
1191
|
+
content: "";
|
|
1192
|
+
background: #000000a6;
|
|
1193
|
+
border-radius: 3.40282e38px;
|
|
1194
|
+
margin: auto;
|
|
1195
|
+
position: absolute;
|
|
1196
|
+
inset: 0;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
.cite-video:after {
|
|
1200
|
+
height: calc(var(--spacing) * 4);
|
|
1201
|
+
width: calc(var(--spacing) * 3.5);
|
|
1202
|
+
--tw-translate-x: 10%;
|
|
1203
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1204
|
+
content: "";
|
|
1205
|
+
clip-path: polygon(0 0, 100% 50%, 0 100%);
|
|
1206
|
+
background: #fff;
|
|
1207
|
+
margin: auto;
|
|
1208
|
+
position: absolute;
|
|
1209
|
+
inset: 0;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
.cite-photo {
|
|
1213
|
+
margin-top: calc(var(--spacing) * 2);
|
|
1214
|
+
display: block;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
.cite-photo img {
|
|
1218
|
+
border-radius: var(--radius-sm);
|
|
1219
|
+
max-width: 100%;
|
|
1220
|
+
height: auto;
|
|
1221
|
+
display: block;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1159
1224
|
.post-header {
|
|
1160
1225
|
margin-bottom: calc(var(--spacing) * 8);
|
|
1161
1226
|
}
|
|
@@ -2283,6 +2348,24 @@
|
|
|
2283
2348
|
initial-value: solid;
|
|
2284
2349
|
}
|
|
2285
2350
|
|
|
2351
|
+
@property --tw-translate-x {
|
|
2352
|
+
syntax: "*";
|
|
2353
|
+
inherits: false;
|
|
2354
|
+
initial-value: 0;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
@property --tw-translate-y {
|
|
2358
|
+
syntax: "*";
|
|
2359
|
+
inherits: false;
|
|
2360
|
+
initial-value: 0;
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
@property --tw-translate-z {
|
|
2364
|
+
syntax: "*";
|
|
2365
|
+
inherits: false;
|
|
2366
|
+
initial-value: 0;
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2286
2369
|
@property --tw-space-y-reverse {
|
|
2287
2370
|
syntax: "*";
|
|
2288
2371
|
inherits: false;
|