mirror of
https://github.com/lbr77/blog-astro.git
synced 2026-04-09 00:19:12 +00:00
banner
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"start": "astro dev",
|
"start": "astro dev",
|
||||||
"build": "astro check && astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro",
|
"astro": "astro",
|
||||||
"prettier": "prettier --write **/*.{ts,tsx,css,astro} --ignore-path .gitignore",
|
"prettier": "prettier --write **/*.{ts,tsx,css,astro} --ignore-path .gitignore",
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ export function normalizePost(post: NotionPost): CollectionEntry<'blog'> {
|
|||||||
tags: Array.isArray(post.Tags) ? post.Tags : [],
|
tags: Array.isArray(post.Tags) ? post.Tags : [],
|
||||||
draft: !(post.Published ?? true),
|
draft: !(post.Published ?? true),
|
||||||
authors: [DEFAULT_AUTHOR_ID],
|
authors: [DEFAULT_AUTHOR_ID],
|
||||||
|
banner,
|
||||||
image,
|
image,
|
||||||
},
|
},
|
||||||
body: '',
|
body: '',
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ try {
|
|||||||
]
|
]
|
||||||
: []
|
: []
|
||||||
: await getTOCSections(currentPostId)
|
: await getTOCSections(currentPostId)
|
||||||
heroImage = post?.data?.banner
|
heroImage = post?.data?.banner ?? post?.data?.image ?? null
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('blog page render failed:', error)
|
console.error('blog page render failed:', error)
|
||||||
return Astro.rewrite('/500')
|
return Astro.rewrite('/500')
|
||||||
|
|||||||
Reference in New Issue
Block a user