From f9397935bd36e4f637e20c3f7f9b7e55df81d3da Mon Sep 17 00:00:00 2001 From: isUnknown Date: Sat, 9 Mar 2024 17:06:24 +0100 Subject: [PATCH] add author page --- site/config/config.php | 3 ++- site/snippets/tabs.php | 36 +++++++++++++++++++++--------------- site/templates/author.php | 3 ++- site/templates/linear.php | 2 +- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/site/config/config.php b/site/config/config.php index dda8bdc..7494df9 100644 --- a/site/config/config.php +++ b/site/config/config.php @@ -49,7 +49,7 @@ return [ ], 'routes' => [ [ - 'pattern' => 'auteur/(:any)', + 'pattern' => 'auteurs/(:any)', 'action' => function ($slug) { $kirby = kirby(); $author = getAuthorBySlug($slug); @@ -61,6 +61,7 @@ return [ 'content' => [ 'title' => $author->name(), 'presentation' => $author->presentation(), + 'author' => $author->name(), 'uuid' => Uuid::generate(), ] ]); diff --git a/site/snippets/tabs.php b/site/snippets/tabs.php index cbf3819..7d85ec9 100644 --- a/site/snippets/tabs.php +++ b/site/snippets/tabs.php @@ -1,5 +1,6 @@
title() ?>
children() as $article): ?> -
  • - -

    title() ?>

    -
    - - -
  • + author()->toUser()->name()->value()) : ?> +
  • + +

    title() ?>

    +
    + + +
  • + diff --git a/site/templates/author.php b/site/templates/author.php index 2403425..b8020e4 100644 --- a/site/templates/author.php +++ b/site/templates/author.php @@ -18,7 +18,8 @@ 'left' => [ 'label' => 'PrĂ©sentation', 'content' => $page->presentation() - ] + ], + 'authorFilter' => $page->author() ]) ?> \ No newline at end of file diff --git a/site/templates/linear.php b/site/templates/linear.php index 87a7136..cbeca56 100644 --- a/site/templates/linear.php +++ b/site/templates/linear.php @@ -11,7 +11,7 @@

    title() ?>

    -

    Par author()->toUser()->name() ?>

    +

    par author()->toUser()->name() ?>

    [