feat: regularize front-matter, add new-post command

This commit is contained in:
saicaca
2023-10-18 17:31:11 +08:00
parent ad67a86ef9
commit 767d351bd5
15 changed files with 95 additions and 43 deletions

View File

@@ -24,7 +24,7 @@ const { Content } = await entry.render();
const { remarkPluginFrontmatter } = await entry.render();
---
<MainGridLayout banner={entry.data.cover} title={entry.data.title}>
<MainGridLayout banner={entry.data.cover.url} title={entry.data.title}>
<div class="flex w-full rounded-[var(--radius-large)] overflow-hidden relative mb-4">
<div class:list={["card-base z-10 px-4 md:px-9 py-6 relative w-full ",
{}
@@ -61,18 +61,18 @@ const { remarkPluginFrontmatter } = await entry.render();
<!-- metadata -->
<PostMetadata
class="mb-5"
pubDate={entry.data.pubDate}
published={entry.data.published}
tags={entry.data.tags}
categories={entry.data.categories}
></PostMetadata>
<!-- always show cover as long as it has one -->
{entry.data.cover &&
<ImageBox src={entry.data.cover} class="mb-8 rounded-xl"/>
{entry.data.cover.url &&
<ImageBox src={entry.data.cover.url} class="mb-8 rounded-xl"/>
}
{!entry.data.cover && <div class="border-[var(--line-divider)] border-dashed border-b-[1px] mb-5"></div>}
{!entry.data.cover.url && <div class="border-[var(--line-divider)] border-dashed border-b-[1px] mb-5"></div>}
<div class="prose dark:prose-invert prose-sm md:prose-base max-w-none custom-md
">