mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Use newsletter's title and author as page's ones
This commit is contained in:
parent
e1e0ddf7fc
commit
adfaf6b8ce
2 changed files with 6 additions and 10 deletions
|
|
@ -35,22 +35,19 @@ export const saveEmail = async (
|
|||
},
|
||||
true
|
||||
)
|
||||
|
||||
const title = input.title
|
||||
const content = parseResult.parsedContent?.content || input.originalContent
|
||||
const slug = generateSlug(title)
|
||||
|
||||
const slug = generateSlug(input.title)
|
||||
const metadata = await parseUrlMetadata(url)
|
||||
|
||||
const articleToSave: Page = {
|
||||
id: '',
|
||||
userId: ctx.uid,
|
||||
slug,
|
||||
content,
|
||||
originalHtml: input.originalContent,
|
||||
content: content,
|
||||
description: metadata?.description || parseResult.parsedContent?.excerpt,
|
||||
title: metadata?.title || parseResult.parsedContent?.title || title,
|
||||
author:
|
||||
metadata?.author || parseResult.parsedContent?.byline || input.author,
|
||||
title: input.title,
|
||||
author: input.author,
|
||||
url: normalizeUrl(parseResult.canonicalUrl || url, {
|
||||
stripHash: true,
|
||||
stripWWW: false,
|
||||
|
|
@ -59,7 +56,6 @@ export const saveEmail = async (
|
|||
hash: stringToHash(content),
|
||||
image: metadata?.previewImage || parseResult.parsedContent?.previewImage,
|
||||
publishedAt: validatedDate(parseResult.parsedContent?.publishedDate),
|
||||
slug: slug,
|
||||
createdAt: new Date(),
|
||||
savedAt: new Date(),
|
||||
readingProgressAnchorIndex: 0,
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ export class NewsletterHandler {
|
|||
const url =
|
||||
this.parseNewsletterUrl(postHeader, html) ||
|
||||
`${this.defaultUrl}?source=newsletters&id=${uuidv4()}`
|
||||
const author = this.parseAuthor(from) || 'Unknown'
|
||||
const author = this.parseAuthor(from)
|
||||
const unsubscribe = this.parseUnsubscribe(unSubHeader)
|
||||
const message = {
|
||||
email,
|
||||
|
|
|
|||
Loading…
Reference in a new issue