Adds Prettier formatting and PHP support

Adds Prettier for consistent code formatting across the project.
Includes PHP plugin and configures formatting for PHP files.
Adds format and format:check scripts to package.json for ease of use.
This commit is contained in:
2025-09-06 12:10:22 +02:00
parent d848d09800
commit 94078a7e6f
4 changed files with 258 additions and 17 deletions
+8 -15
View File
@@ -1,6 +1,6 @@
<div class="py-16">
<h2>Neuigkeiten aus dem Verein</h2>
<?php foreach($news as $post): ?>
<?php foreach ($news as $post): ?>
<article class="relative flex flex-col gap-8 lg:flex-row py-12">
<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-xl object-cover" />
@@ -9,11 +9,13 @@
<div>
<div class="flex items-center gap-x-4 text-m justify-between">
<div>
<time class="text-gray-500"><?= $post->date()->toDate("d.m.Y") ?></time>
<time class="text-gray-500"><?= $post->date()->toDate('d.m.Y') ?></time>
</div>
<div>
<?php foreach($post->tags()->split() as $tag): ?>
<a href="<?= page('news')->url(['params' => ['tag' => $tag]]) ?>" class="relative z-10 rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100"><?= $tag ?></a>
<?php foreach ($post->tags()->split() as $tag): ?>
<a href="<?= page('news')->url([
'params' => ['tag' => $tag],
]) ?>" class="relative z-10 rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100"><?= $tag ?></a>
<?php endforeach; ?>
</div>
</div>
@@ -41,17 +43,8 @@
</div>
</div>
</div>
<?php endif ?>
<?php endif; ?>
</div>
</article>
<?php endforeach ?>
<?php if(param('tag')): ?>
<div class="my-8">
<a href="<?= $page->url() ?>" class="bg-gray-100 hover:bg-gray-200 text-gray-800 font-semibold py-2 px-4 rounded">
Alle Beiträge anzeigen
</a>
</div>
<?php endif ?>
<?php endforeach; ?>
</div>