mirror of
https://github.com/lbr77/blog-astro.git
synced 2026-04-09 00:19:12 +00:00
refactor: remove unused description style and related logic
This commit is contained in:
@@ -121,13 +121,6 @@ const titleStyle: CSSProperties = {
|
|||||||
whiteSpace: 'pre-line',
|
whiteSpace: 'pre-line',
|
||||||
}
|
}
|
||||||
|
|
||||||
const descriptionStyle: CSSProperties = {
|
|
||||||
fontSize: 30,
|
|
||||||
lineHeight: 1.45,
|
|
||||||
color: 'rgba(15, 23, 42, 0.75)',
|
|
||||||
whiteSpace: 'pre-line',
|
|
||||||
}
|
|
||||||
|
|
||||||
const metaRowStyle: CSSProperties = {
|
const metaRowStyle: CSSProperties = {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
@@ -177,7 +170,6 @@ export const GET: APIRoute = async ({ params }) => {
|
|||||||
const remotePost = slug ? await fetchRemotePost(slug) : null
|
const remotePost = slug ? await fetchRemotePost(slug) : null
|
||||||
const post = remotePost ? normalizePost(remotePost.post) : null
|
const post = remotePost ? normalizePost(remotePost.post) : null
|
||||||
const title = post?.data?.title || SITE.title
|
const title = post?.data?.title || SITE.title
|
||||||
const description = post?.data?.description || SITE.description
|
|
||||||
const dateValue = post?.data?.date ?? null
|
const dateValue = post?.data?.date ?? null
|
||||||
const meta = dateValue
|
const meta = dateValue
|
||||||
? `${SITE.title} | ${formatDate(dateValue)}`
|
? `${SITE.title} | ${formatDate(dateValue)}`
|
||||||
@@ -185,7 +177,6 @@ export const GET: APIRoute = async ({ params }) => {
|
|||||||
const siteHost = new URL(SITE.href).host
|
const siteHost = new URL(SITE.href).host
|
||||||
const formattedDate = dateValue ? formatDate(dateValue) : null
|
const formattedDate = dateValue ? formatDate(dateValue) : null
|
||||||
const titleBlock = wrapAsBlock(title, 24, 2)
|
const titleBlock = wrapAsBlock(title, 24, 2)
|
||||||
const descriptionBlock = wrapAsBlock(description, 44, 3)
|
|
||||||
|
|
||||||
const badge = createElement('div', { style: badgeStyle }, [
|
const badge = createElement('div', { style: badgeStyle }, [
|
||||||
createElement('span', { style: badgeDotStyle }),
|
createElement('span', { style: badgeDotStyle }),
|
||||||
@@ -198,12 +189,6 @@ export const GET: APIRoute = async ({ params }) => {
|
|||||||
createElement('div', { style: titleStyle }, titleBlock),
|
createElement('div', { style: titleStyle }, titleBlock),
|
||||||
]
|
]
|
||||||
|
|
||||||
if (descriptionBlock) {
|
|
||||||
cardChildren.push(
|
|
||||||
createElement('div', { style: descriptionStyle }, descriptionBlock),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const metaRow = createElement('div', { style: metaRowStyle }, [
|
const metaRow = createElement('div', { style: metaRowStyle }, [
|
||||||
createElement('div', { style: metaLeftStyle }, [
|
createElement('div', { style: metaLeftStyle }, [
|
||||||
createElement('div', { style: metaLabelStyle }, 'PUBLISHED'),
|
createElement('div', { style: metaLabelStyle }, 'PUBLISHED'),
|
||||||
|
|||||||
Reference in New Issue
Block a user