refactor: unify template structure by introducing a layout snippet

Replaces repetitive header, navbar, and footer code in templates with a centralized `layout` snippet for better maintainability. Cleans up and simplifies various template snippets.
This commit is contained in:
2025-06-29 12:15:33 +02:00
parent 67746c91eb
commit 09a1515025
11 changed files with 179 additions and 410 deletions
+3 -33
View File
@@ -1,32 +1,6 @@
<?php
/*
Templates render the content of your pages.
<?php snippet('layout', slots: true) ?>
They contain the markup together with some control structures
like loops or if-statements. The `$page` variable always
refers to the currently active page.
To fetch the content from each field we call the field name as a
method on the `$page` object, e.g. `$page->title()`.
This default template must not be removed. It is used whenever Kirby
cannot find a template with the name of the content file.
Snippets like the header and footer contain markup used in
multiple templates. They also help to keep templates clean.
More about templates: https://getkirby.com/docs/guide/templates/basics
*/
?>
<?php
snippet('header') ?>
<body class="font-sans antialiased bg-sf_grau-400 text-gray-900">
<?php
snippet('navbar') ?>
<section class="bg-sf_grau-50 py-24">
<section class="bg-sf_grau-50 py-24">
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<h1 class="text-3xl font-bold text-center mb-8">Vereinssatzung der „Schachfreunde Bad Steben“</h1>
<section class="mb-6">
@@ -156,8 +130,4 @@ snippet('navbar') ?>
</div>
</section>
<?= js('assets/js/navbar.js') ?>
</body>
<?php
snippet('footer') ?>
<?php endsnippet() ?>