feat: render CMS content fields and footer settings

This commit is contained in:
2026-10-11 19:44:54 +08:00
parent 870b9b4282
commit f990df3023
19 changed files with 250 additions and 38 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ import type {
*/
export async function getBlogList(): Promise<BlogPageSummary[]> {
const res = await fetchAPI<WagtailListResponse<BlogPageSummary>>(
"/api/v2/pages/?type=blog.BlogPage&fields=intro,published_at&order=-published_at",
"/api/v2/pages/?type=blog.BlogPage&fields=intro,published_at,cover_image,tags&order=-published_at",
{ tags: ["blog-list"] },
);
return res.items;
@@ -21,7 +21,7 @@ export async function getBlogList(): Promise<BlogPageSummary[]> {
*/
export async function getBlogBySlug(slug: string): Promise<BlogPageDetail | null> {
const res = await fetchAPI<WagtailListResponse<BlogPageDetail>>(
`/api/v2/pages/?type=blog.BlogPage&slug=${encodeURIComponent(slug)}&fields=body,intro,published_at&limit=1`,
`/api/v2/pages/?type=blog.BlogPage&slug=${encodeURIComponent(slug)}&fields=body,intro,published_at,cover_image,tags&limit=1`,
{ tags: [`blog:${slug}`] },
);
return res.items[0] ?? null;