diff --git a/assets/css/src/article.css b/assets/css/src/article.css
index 10bd7a9..e31ea9a 100644
--- a/assets/css/src/article.css
+++ b/assets/css/src/article.css
@@ -9,6 +9,14 @@ article #main-content {
font-style: italic;
}
+#main-content .texts {
+ margin-top: calc(2 * var(--unit--vertical));
+}
+
+#main-content .see-more {
+ margin-top: calc(var(--unit--vertical) * 0.5);
+}
+
#chapo em {
font-style: normal;
}
diff --git a/site/config/routes/virtual-category.php b/site/config/routes/virtual-category.php
index 95b525c..37bb2fe 100644
--- a/site/config/routes/virtual-category.php
+++ b/site/config/routes/virtual-category.php
@@ -1,3 +1,4 @@
+
'categories/(:any)',
'action' => function ($category) {
- $kirby = kirby();
-
- return Page::factory(
- [
- 'slug' => '',
- 'template' => 'category',
- 'model' => 'categories',
- 'content' => [
+ return Page::factory([
+ 'slug' => Str::slug($category) . '-' . Uuid::generate(),
+ 'template' => 'category',
+ 'model' => 'category',
+ 'content' => [
'title' => $category,
'uuid' => Uuid::generate(),
- ]
- ]
- );
+ ],
+ ]);
}
];
diff --git a/site/models/category.php b/site/models/category.php
new file mode 100644
index 0000000..bb60265
--- /dev/null
+++ b/site/models/category.php
@@ -0,0 +1,23 @@
+title()->value();
+ $allTexts = page("textes")->grandChildren();
+ $textsInCategory = $allTexts->filterBy('category', $category);
+
+ $children = new Pages();
+
+ foreach ($textsInCategory as $text) {
+ $children->add($text);
+ }
+
+ return $children;
+ }
+}
diff --git a/site/templates/category.php b/site/templates/category.php
index 6111077..e55c9a5 100644
--- a/site/templates/category.php
+++ b/site/templates/category.php
@@ -1,36 +1,58 @@
-
-
+
-
-
-
-
-
- = $page->title() ?>
+
+ true), slots: true) ?>
+
+ = $page->title() ?>
+
+
+
+
+ edito()->isNotEmpty()): ?>
+
+ = $page->edito() ?>
+
+
+
- collection('categories') as $category): ?>
- title() == $page->title()): ?>
-
- -
-
-
= $article->title() ?>
-
-
-
-
-
-
+ children() as $article): ?>
+
+
+ = $article->title() ?>
+
+
+
+ par
+ author()->toPage()->title();
+ } catch (\Throwable $th) {
+ throw new Exception(json_encode($article->author()), 1);
+
+ }
+ ?>
+ = $article->author()->toPage()->title() ?>
+ publiƩ le = $article->published()->toDate('d/m/Y') ?>
+ dans = $article->parent()->title() ?> / = $article->category() ?>
+
+
+
-
-
-
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/site/templates/year.php b/site/templates/year.php
index 01861cb..225f0b9 100644
--- a/site/templates/year.php
+++ b/site/templates/year.php
@@ -4,20 +4,29 @@
true), slots: true) ?>
= $page->title() ?>
- subtitle()->isNotEmpty()): ?>
- = $page->subtitle()->inline() ?>
-
ouverte depuis le = $page->openDate()->toDate('d/m/Y') ?>
-
- chapo()->isNotEmpty()): ?>
-
- = $page->chapo() ?>
+
+ edito()->isNotEmpty()): ?>
+
+ = $page->edito() ?>
+
children() as $article): ?>