Skip to content

Commit

Permalink
fix: jsonfeed-to-rss missing title
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jul 25, 2023
1 parent 9575604 commit 15a0bfb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/site/[site]/feed/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function GET(
}),
items: pages.list?.map((page) => ({
id: page.characterId + "-" + page.noteId,
title: page.metadata?.content?.title,
title: page.metadata?.content?.title || "Untitled",
summary: page.metadata?.content?.summary,
content_html: page.metadata?.content?.contentHTML,
url: `${SITE_URL}/api/redirection?characterId=${page.characterId}&noteId=${page.noteId}`,
Expand Down
1 change: 0 additions & 1 deletion src/components/common/CommentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ export const CommentInput = ({
})

requestAnimationFrame(() => {
// console.log(view.state.doc.toString(), "statevalue")
form.setValue("content", view.state.doc.toString())
})
}}
Expand Down
7 changes: 4 additions & 3 deletions src/lib/json-feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ export const parsePost = (post: ExpandedNote, withTwitter?: boolean) => {
}
return {
id: `${post.characterId}-${post.noteId}`,
title: `${post.metadata?.content?.title}${
withTwitter && twitter ? ` by @${twitter}` : ""
}`,
title:
`${post.metadata?.content?.title}${
withTwitter && twitter ? ` by @${twitter}` : ""
}` || "Untitled",
summary: post.metadata?.content?.summary,
content_html: post.metadata?.content?.contentHTML,
url: `${SITE_URL}/api/redirection?characterId=${post.characterId}&noteId=${post.noteId}`,
Expand Down
2 changes: 1 addition & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default async function middleware(req: NextRequest) {
return NextResponse.redirect(`https://${req.headers.get("host")}/feed`, 301)
}

console.log(`${req.method} ${req.nextUrl.pathname}${req.nextUrl.search}`)
console.debug(`${req.method} ${req.nextUrl.pathname}${req.nextUrl.search}`)

if (
pathname.startsWith("/api/") ||
Expand Down
2 changes: 1 addition & 1 deletion src/models/site.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export async function fetchTenant(
)
const txt = await res.json()
if (txt.Status === 5 && retries > 0) {
console.log("retrying", host, retries - 1)
console.warn("retrying", host, retries - 1)
return await fetchTenant(host, retries - 1)
} else {
return txt?.Answer?.[0]?.data.replace(/^"|"$/g, "")
Expand Down

0 comments on commit 15a0bfb

Please sign in to comment.