test fix for new theme

This commit is contained in:
Adam Matthiesen 2024-02-10 08:36:14 -08:00
parent e022ad5d9a
commit 1bd9364dcb
3 changed files with 46 additions and 32 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@matthiesenxyz/astro-ghostcms-brutalbyelian",
"description": "ElianCodes Brutal theme modified to work with Astro-GhostCMS",
"version": "0.0.1-dev01",
"version": "0.0.1-dev02",
"homepage": "https://astro-ghostcms.xyz/",
"type": "module",
"license": "MIT",

View File

@ -0,0 +1,43 @@
---
import type { Settings, Post } from "@matthiesenxyz/astro-ghostcms/api";
import { formatDate } from "../../utils";
import FeatureImage from "../generic/Featureimage.astro";
export type Props = {
post: Post;
settings: Settings;
};
const { post, settings } = Astro.props as Props;
---
<header class="article-header gh-canvas">
<div class="flex justify-between my-4">
<section class="flex flex-grow align-middle">
<div class="text-ctp-overlay2">
{ post.primary_author && (
<h4 class="text-ctp-teal">Author:
{post.primary_author.name}
</h4>
)}
<div class="text-ctp-overlay2">
<time class="text-ctp-sapphire" datetime={formatDate(post.created_at)}
>{formatDate(post.created_at)}
</time>
<span class="text-ctp-peach"
><span class="text-ctp-overlay2">&bull;</span>
{post.reading_time} min read
</span>
</div>
</div>
</section>
</div>
{post.feature_image && (
<FeatureImage
image={post.feature_image}
alt={post.feature_image_alt ? post.feature_image_alt : post.title}
caption={post.feature_image_caption || "" }
settings={settings}
transitionName={`img-${post.title}`}
/>
)}
</header>

View File

@ -5,6 +5,7 @@ import type { InferGetStaticPropsType } from "astro";
import RecentBlogPosts from "../components/generic/RecentBlogPosts.astro";
import FeatureImage from "../components/generic/Featureimage.astro";
import { formatDate } from "../utils";
import BlogPostHeader from "../components/blog/BlogPostHeader.astro";
export async function getStaticPaths() {
const [posts, pages, settings] = await Promise.all([getAllPosts(), await getAllPages(), await getSettings()]);
@ -22,37 +23,7 @@ invariant(settings, "Settings are required");
<BlogPost title={post.title} description={post.excerpt}>
<article class='prose-slate w-sm md:w-prose md:prose poppins pl-4'>
<header class="article-header gh-canvas">
<div class="flex justify-between my-4">
<section class="flex flex-grow align-middle">
<div class="text-ctp-overlay2">
{ post.primary_author && (
<h4 class="text-ctp-teal">Author:
{post.primary_author.name}
</h4>
)}
<div class="text-ctp-overlay2">
<time class="text-ctp-sapphire" datetime={formatDate(post.created_at)}
>{formatDate(post.created_at)}
</time>
<span class="text-ctp-peach"
><span class="text-ctp-overlay2">&bull;</span>
{post.reading_time} min read
</span>
</div>
</div>
</section>
</div>
{post.feature_image && (
<FeatureImage
image={post.feature_image}
alt={post.feature_image_alt ? post.feature_image_alt : post.title}
caption={post.feature_image_caption || "" }
settings={settings}
transitionName={`img-${post.title}`}
/>
)}
</header>
<BlogPostHeader post={post} settings={settings} />
<Fragment set:html={post.html} />
</article>