add front-comments

This commit is contained in:
isUnknown 2024-03-09 15:09:31 +01:00
parent 8a457885b2
commit ed81ac26d2
11 changed files with 377 additions and 50 deletions

View file

@ -1,4 +1,4 @@
title: Articles
title: texts
columns:
- width: 1/2

View file

@ -6,7 +6,7 @@ image:
columns:
- width: 1/3
sections:
articles:
texts:
type: pages
templates:
- linear

View file

@ -1,5 +1,5 @@
<?php
return function ($site) {
return $site->find('articles')->children();
};
return $site->find('texts')->children();
};

View file

@ -7,17 +7,17 @@ return [
'site' => [
'label' => 'Accueil',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'site');
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'site');
}
],
'articles' => [
'texts' => [
'icon' => 'pen',
'label' => 'Articles',
'link' => 'pages/articles',
'label' => 'texts',
'link' => 'pages/texts',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/articles');
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/texts');
}
],
'-',
@ -26,8 +26,8 @@ return [
'label' => 'À propos',
'link' => 'pages/a-propos',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/a-propos');
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/a-propos');
}
],
'newsletter' => [
@ -35,13 +35,14 @@ return [
'label' => 'Lettre',
'link' => 'pages/lettre',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/lettre');
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/lettre');
}
],
'-',
'users',
'comments',
'system'
]
]
];
];

View file

@ -8,5 +8,7 @@
<script src="<?= url('assets') ?>/js/script.js" defer></script>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<meta name="robots" content="noindex">
</head>
<body class="grid">

View file

@ -1,4 +1,4 @@
<?php
<?php
$left['slug'] = Str::slug($left['label']);
?>
@ -15,9 +15,9 @@ $left['slug'] = Str::slug($left['label']);
><?= $left['label'] ?></button>
<button
class="toggle right"
:class="activeTab === 'articles' ? 'open' : 'close'"
@click="toggleTab($data, 'articles')"
>articles</button>
:class="activeTab === 'texts' ? 'open' : 'close'"
@click="toggleTab($data, 'texts')"
>textes</button>
</div>
<div class="active-tab">
<section
@ -27,7 +27,7 @@ $left['slug'] = Str::slug($left['label']);
<?= $left['content'] ?>
</section>
<ul
x-show="activeTab === 'articles'"
x-show="activeTab === 'texts'"
x-transition.opacity
x-transition.duration.500ms>
<?php foreach($kirby->collection('years') as $year): ?>