More things

This commit is contained in:
2026-10-01 02:29:21 +02:00
parent e1df4d3ae1
commit 13b659662e
54 changed files with 4409 additions and 911 deletions

View File

@@ -44,17 +44,22 @@ export function useArticleLibrary() {
}
function put(key: string, article: ReaderArticle) {
/* the one address a version answers to, whatever asked for it: the short
/wiki/<slug> form fetches by document and the versioned form by
(identity, language), and both are the same page of the shelf */
const version = versionKey(identityOf(article), articleLanguage(article))
delete unreadable.value[key]
delete unreadable.value[versionKey(identityOf(article), article.language ?? 'en')]
delete unreadable.value[version]
shelf.value[key] = article
/* a version also answers to its document's own slug, where it was fetched
from and where the panes keep it */
from and where the panes keep it, and to the version it is */
shelf.value[article.slug] = article
shelf.value[version] = article
}
function forget(slug: string) {
const article = shelf.value[slug]
if (article) delete shelf.value[versionKey(identityOf(article), article.language ?? 'en')]
if (article) delete shelf.value[versionKey(identityOf(article), articleLanguage(article))]
delete shelf.value[slug]
delete unreadable.value[slug]
}