books-ui: library, detail page, EPUB/PDF reader, reading status/rating/sessions migration, progress/notes APIs, owner gating and tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { listSummaries } from '#lib/server/lists.js';
|
||||
import { db } from '#lib/server/db/index.js';
|
||||
import { blogArticles } from '#lib/server/db/schema/index.js';
|
||||
import { blogArticles, bookWorks } from '#lib/server/db/schema/index.js';
|
||||
import { SITE_ORIGIN } from '#lib/seo.js';
|
||||
import { races } from '#lib/derby/races.js';
|
||||
import { COURSES } from '#lib/language-learner/courses/index.js';
|
||||
@@ -13,6 +13,7 @@ const staticPaths = [
|
||||
'/trackers',
|
||||
'/blog',
|
||||
'/lists',
|
||||
'/trackers/books',
|
||||
'/projects/game-tracker',
|
||||
'/projects/game-tracker/pokemon',
|
||||
'/projects/game-tracker/osu',
|
||||
@@ -40,12 +41,13 @@ function escapeXml(value: string): string {
|
||||
}
|
||||
|
||||
export const GET: RequestHandler = async () => {
|
||||
const [articles, lists] = await Promise.all([
|
||||
const [articles, lists, books] = await Promise.all([
|
||||
db
|
||||
.select({ slug: blogArticles.slug, updatedAt: blogArticles.updatedAt })
|
||||
.from(blogArticles)
|
||||
.where(eq(blogArticles.status, 'published')),
|
||||
listSummaries()
|
||||
listSummaries(),
|
||||
db.select({ id: bookWorks.id, updatedAt: bookWorks.updatedAt }).from(bookWorks)
|
||||
]);
|
||||
const entries: { path: string; lastmod?: string }[] = [
|
||||
...staticPaths.map((path) => ({ path })),
|
||||
@@ -54,7 +56,11 @@ export const GET: RequestHandler = async () => {
|
||||
path: `/blog/${encodeURIComponent(article.slug)}`,
|
||||
lastmod: article.updatedAt.toISOString()
|
||||
})),
|
||||
...lists.map((list) => ({ path: `/lists/${encodeURIComponent(list.slug)}` }))
|
||||
...lists.map((list) => ({ path: `/lists/${encodeURIComponent(list.slug)}` })),
|
||||
...books.map((book) => ({
|
||||
path: `/trackers/books/${book.id}`,
|
||||
lastmod: book.updatedAt.toISOString()
|
||||
}))
|
||||
];
|
||||
const body = `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${entries
|
||||
.map(
|
||||
|
||||
Reference in New Issue
Block a user