mirror of
https://github.com/Pantonius/pantosite-astro.git
synced 2026-04-26 17:34:39 +00:00
Very first version of pantosite-astro
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
---
|
||||
import type { CollectionEntry } from 'astro:content';
|
||||
import BaseHead from '../components/BaseHead.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import FormattedDate from '../components/FormattedDate.astro';
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
import BaseHead from "../components/BaseHead.astro";
|
||||
import Header from "../components/Header.astro";
|
||||
import Footer from "../components/Footer.astro";
|
||||
import FormattedDate from "../components/FormattedDate.astro";
|
||||
|
||||
type Props = CollectionEntry<'blog'>['data'];
|
||||
type Props = CollectionEntry<"blog">["data"];
|
||||
|
||||
const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
|
||||
---
|
||||
@@ -19,35 +19,59 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
|
||||
max-width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h1::after {
|
||||
content: "";
|
||||
display: block;
|
||||
/* width: 100%; */
|
||||
height: 2px;
|
||||
background-color: var(--primary);
|
||||
margin: 0.5rem auto;
|
||||
}
|
||||
|
||||
h2::after {
|
||||
content: "";
|
||||
display: block;
|
||||
/* width: 100%; */
|
||||
height: 2px;
|
||||
background-color: var(--primary);
|
||||
margin: 0.5rem auto;
|
||||
}
|
||||
|
||||
.hero-image {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.hero-image img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
border-radius: 12px;
|
||||
box-shadow: var(--box-shadow);
|
||||
}
|
||||
|
||||
.prose {
|
||||
width: 720px;
|
||||
max-width: calc(100% - 2em);
|
||||
max-width: 100%;
|
||||
margin: auto;
|
||||
padding: 1em;
|
||||
color: rgb(var(--gray-dark));
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-bottom: 1em;
|
||||
padding: 1em 0;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.title h1 {
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
|
||||
.date {
|
||||
margin-bottom: 0.5em;
|
||||
color: rgb(var(--gray));
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.last-updated-on {
|
||||
font-style: italic;
|
||||
}
|
||||
@@ -59,7 +83,16 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
|
||||
<main>
|
||||
<article>
|
||||
<div class="hero-image">
|
||||
{heroImage && <img width={1020} height={510} src={heroImage} alt="" />}
|
||||
{
|
||||
heroImage && (
|
||||
<img
|
||||
width={1020}
|
||||
height={510}
|
||||
src={heroImage}
|
||||
alt=""
|
||||
/>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<div class="prose">
|
||||
<div class="title">
|
||||
@@ -68,13 +101,13 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
|
||||
{
|
||||
updatedDate && (
|
||||
<div class="last-updated-on">
|
||||
Last updated on <FormattedDate date={updatedDate} />
|
||||
Last updated on{" "}
|
||||
<FormattedDate date={updatedDate} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<h1>{title}</h1>
|
||||
<hr />
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user