Skip to content

Commit

Permalink
feature: add features
Browse files Browse the repository at this point in the history
  • Loading branch information
diegosteiner committed Jan 18, 2024
1 parent 0405b20 commit 27153ea
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 8 deletions.
Binary file added src/assets/calendar-3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineCollection, z } from 'astro:content';

const features = defineCollection({
type: 'content',
schema: ({ image }) => z.object({
title: z.string(),
lead: z.string().optional(),
image: image().optional(),
tags: z.array(z.string()).optional()
}),
});

export const collections = { features };
8 changes: 8 additions & 0 deletions src/content/features/digests/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Auszüge
lead: Daten einfach aus HeimV exportieren
image: ./screenshot.png
---



Binary file added src/content/features/digests/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/layouts/Markdown.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
---

<div class="prose prose-headings:font-heading prose-p:my-3 max-w-full">
<slot />
</div>
7 changes: 4 additions & 3 deletions src/layouts/MarkdownLayout.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
import Layout from "./Layout.astro";
import Markdown from "./Markdown.astro";
const { frontmatter } = Astro.props;
---

<Layout title={frontmatter.title}>
<main class="container mx-auto max-w-3xl p-4 h-min-screen">
<main class="container mx-auto max-w-3xl p-4 min-h-screen">
<div class="bg-white rounded-md shadow p-10">
<div class="prose prose-headings:font-heading prose-p:my-3 max-w-full">
<Markdown>
<slot />
</div>
</Markdown>
</div>
</main>
</Layout>
14 changes: 9 additions & 5 deletions src/pages/features/[...slug]/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { type CollectionEntry, getCollection } from "astro:content";
import Layout from "../../../layouts/Layout.astro";
import { Image } from "astro:assets";
import Markdown from "../../../layouts/Markdown.astro";
export async function getStaticPaths() {
const features = await getCollection("features");
Expand All @@ -14,13 +15,16 @@ type Props = CollectionEntry<"features">;
const feature = Astro.props;
const { Content } = await feature.render();
const { title, image } = feature.data;
const { title, lead, image } = feature.data;
---

<Layout title={title}>
<main class="container pb-4 mt-5 mx-auto">
<Image src={image} alt={title} />
<h1 class="text-7xl text-center">{title}</h1>
<Content />
<main class="container mx-auto max-w-5xl p-4 min-h-screen">
<h1 class="text-5xl font-heading text-center">{title}</h1>
{image && <Image src={image} alt={title} />}
{lead && <p class="text-center italic">{lead}</p>}
<Markdown>
<Content />
</Markdown>
</main>
</Layout>

0 comments on commit 27153ea

Please sign in to comment.