feat: add blog section with blueprint, template, and structured content
Introduced a new blog section with a dedicated blueprint (`blog.yml`) and PHP template (`blog.php`). Added initial content, including hero text, button, and link for improved navigation and communication. Structured layout supports dynamic blog post rendering with author details and summaries.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
Title: News
|
||||
|
||||
----
|
||||
|
||||
Herotext: Unser Verein hat aufregende Neuigkeiten! Wir freuen uns, Sie auf unserer Homepage auf dem Laufenden zu halten. Schauen Sie auch auf unsere alte Homepage, um weitere Informationen und Ressourcen zu finden.
|
||||
|
||||
----
|
||||
|
||||
Herobutton: Archiv
|
||||
|
||||
----
|
||||
|
||||
Buttonlink: https://archiv.schachfreunde-badsteben.de
|
||||
|
||||
----
|
||||
|
||||
Uuid: qtyyzjcbmgvhwzod
|
||||
@@ -1,5 +0,0 @@
|
||||
Title: News
|
||||
|
||||
----
|
||||
|
||||
Uuid: qtyyzjcbmgvhwzod
|
||||
@@ -0,0 +1,24 @@
|
||||
title: Verein
|
||||
|
||||
columns:
|
||||
main:
|
||||
width: 1/2
|
||||
sections:
|
||||
fields:
|
||||
type: fields
|
||||
fields:
|
||||
herotext:
|
||||
label: Text (Hero)
|
||||
type: text
|
||||
herobutton:
|
||||
label: Text für den Button
|
||||
type: text
|
||||
buttonlink:
|
||||
label: Link für den Button
|
||||
type: text
|
||||
sidebar:
|
||||
width: 1/2
|
||||
sections:
|
||||
pages:
|
||||
type: pages
|
||||
template: news
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php snippet('layout', slots: true) ?>
|
||||
|
||||
<?php foreach($page->children() as $post): ?>
|
||||
<article class="relative isolate flex flex-col gap-8 lg:flex-row">
|
||||
<div class="relative aspect-video sm:aspect-2/1 lg:aspect-square lg:w-64 lg:shrink-0">
|
||||
<img src="<?= $post->image()->url() ?>" alt="" class="absolute inset-0 size-full rounded-2xl bg-gray-50 object-cover" />
|
||||
<div class="absolute inset-0 rounded-2xl ring-1 ring-gray-900/10 ring-inset"></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-center gap-x-4 text-xs">
|
||||
<time datetime="2020-03-16" class="text-gray-500"><?= $post->date()->toDate("d.m.Y") ?></time>
|
||||
<a href="#" class="relative z-10 rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100">Marketing</a>
|
||||
</div>
|
||||
<div class="group relative max-w-xl">
|
||||
<h2>
|
||||
<a href="<?= $post->url() ?>" class="relative">
|
||||
<span class="absolute inset-0"></span>
|
||||
<?= $post->headline() ?>
|
||||
</a>
|
||||
</h2>
|
||||
<p><?= $post->summary() ?></p>
|
||||
</div>
|
||||
<?php if ($user = $post->author()->toUser()): ?>
|
||||
<div class="mt-6 flex border-t border-gray-900/5 pt-6">
|
||||
<div class="relative flex items-center gap-x-4">
|
||||
<img src="<?= $user->avatar()->url() ?>" alt="" class="size-10 rounded-full bg-gray-50" />
|
||||
<div class="text-sm/6">
|
||||
<p>
|
||||
<a href="#">
|
||||
<span class="absolute inset-0"></span>
|
||||
<div class="text-xl">
|
||||
<?= $user->username() ?>
|
||||
</div>
|
||||
</a>
|
||||
</p>
|
||||
<p class="text-sm"><?= $user->role()->title() ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php endsnippet() ?>
|
||||
Reference in New Issue
Block a user