This commit is contained in:
isUnknown 2025-01-26 13:00:50 +01:00
parent 6801286c5f
commit aea050f6cc
8 changed files with 36 additions and 73 deletions

View file

@ -23,15 +23,9 @@ function setTitleFontSizeClass($title, $level = 'h1')
function getAuthorBySlug($slug)
{
$kirby = kirby();
$author = '';
foreach ($kirby->users() as $user) {
if (Str::slug($user->name()) === $slug) {
$author = $user;
}
}
$site = site();
$authors = page("auteurs")->children();
$author = $authors->find($slug);
return $author;
}