mirror of
https://github.com/dergigi/boris.git
synced 2026-01-01 22:14:20 +01:00
feat: show article titles for kind:30023 bookmarks
- Update hydrateItems to detect long-form articles (kind:30023) - Extract and display article title using getArticleTitle helper - Article titles now appear as bookmark content in lists - Provides better context for bookmarked articles
This commit is contained in:
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -5,7 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Boris - Nostr Bookmarks</title>
|
||||
<script type="module" crossorigin src="/assets/index-Cu-7RlRs.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-BldIeAhn.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-ChEoItgK.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { getParsedContent } from 'applesauce-content/text'
|
||||
import { getArticleTitle } from 'applesauce-core/helpers'
|
||||
import { ActiveAccount, IndividualBookmark, ParsedContent } from '../types/bookmarks'
|
||||
import type { NostrEvent } from './bookmarkEvents'
|
||||
|
||||
@@ -94,14 +95,24 @@ export function hydrateItems(
|
||||
return items.map(item => {
|
||||
const ev = idToEvent.get(item.id)
|
||||
if (!ev) return item
|
||||
|
||||
// For long-form articles (kind:30023), use the article title as content
|
||||
let content = ev.content || item.content || ''
|
||||
if (ev.kind === 30023) {
|
||||
const articleTitle = getArticleTitle(ev)
|
||||
if (articleTitle) {
|
||||
content = articleTitle
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...item,
|
||||
pubkey: ev.pubkey || item.pubkey,
|
||||
content: ev.content || item.content || '',
|
||||
content,
|
||||
created_at: ev.created_at || item.created_at,
|
||||
kind: ev.kind || item.kind,
|
||||
tags: ev.tags || item.tags,
|
||||
parsedContent: ev.content ? (getParsedContent(ev.content) as ParsedContent) : item.parsedContent
|
||||
parsedContent: ev.content ? (getParsedContent(content) as ParsedContent) : item.parsedContent
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user